{"id":34849,"date":"2025-11-22T20:41:03","date_gmt":"2025-11-22T17:41:03","guid":{"rendered":"https:\/\/fatihsoysal.com\/blog\/?p=34849"},"modified":"2025-11-22T20:41:03","modified_gmt":"2025-11-22T17:41:03","slug":"python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma","status":"publish","type":"post","link":"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/","title":{"rendered":"Python ile GCM (Google Cloud Messaging) Kullanarak Android Cihazlara Push Bildirimleri G\u00f6nderme Sunucusu Olu\u015fturma"},"content":{"rendered":"<p><body><\/p>\n<h2>Python ile GCM (Google Cloud Messaging) Kullanarak Android Cihazlara Push Bildirimleri G\u00f6nderme Sunucusu Olu\u015fturma<\/h2>\n<p>Push bildirimleri, mobil uygulamalar\u0131n kullan\u0131c\u0131lar\u0131yla etkile\u015fim kurmas\u0131n\u0131n en etkili yollar\u0131ndan biridir. Kullan\u0131c\u0131 uygulamay\u0131 aktif olarak kullanm\u0131yorken bile, onlara anl\u0131k mesajlar, g\u00fcncellemeler veya hat\u0131rlat\u0131c\u0131lar g\u00f6ndererek dikkatlerini \u00e7ekebilir ve uygulamaya geri d\u00f6nmelerini sa\u011flayabilirler. Bu teknoloji, e-ticaret uygulamalar\u0131ndan haber uygulamalar\u0131na, sosyal medyadan oyunlara kadar geni\u015f bir yelpazede kullan\u0131lmaktad\u0131r.<\/p>\n<p>Bu makalede, Android cihazlara push bildirimleri g\u00f6ndermek i\u00e7in bir sunucu olu\u015fturma s\u00fcrecini detayl\u0131 bir \u015fekilde inceleyece\u011fiz. \u00d6zellikle, Google&#8217;\u0131n bulut mesajla\u015fma hizmeti olan GCM (Google Cloud Messaging) ve onun modern halefi olan FCM (Firebase Cloud Messaging) teknolojilerini Python programlama dili ile nas\u0131l entegre edece\u011fimizi ad\u0131m ad\u0131m a\u00e7\u0131klayaca\u011f\u0131z. GCM terimi makale ba\u015fl\u0131\u011f\u0131nda yer alsa da, g\u00fcncel ve desteklenen \u00e7\u00f6z\u00fcm olan FCM \u00fczerinden ilerleyece\u011fiz ve GCM&#8217;nin neden art\u0131k kullan\u0131lmad\u0131\u011f\u0131n\u0131 a\u00e7\u0131klayaca\u011f\u0131z. Python&#8217;\u0131n sadeli\u011fi ve g\u00fc\u00e7l\u00fc k\u00fct\u00fcphane ekosistemi sayesinde, bu s\u00fcreci olduk\u00e7a verimli bir \u015fekilde y\u00f6netebiliriz.<\/p>\n<p>Makalenin sonunda, Android uygulaman\u0131z\u0131n bildirim token&#8217;lar\u0131n\u0131 kaydedebilece\u011fi, bu token&#8217;lar\u0131 kullanarak hedeflenen cihazlara bildirimler g\u00f6nderebilece\u011fi ve olas\u0131 hatalar\u0131 y\u00f6netebilece\u011fi temel bir Python sunucusu yap\u0131s\u0131na sahip olacaks\u0131n\u0131z. Ayr\u0131ca, g\u00fcvenlik en iyi uygulamalar\u0131 ve performans ipu\u00e7lar\u0131 hakk\u0131nda da bilgi edineceksiniz.<\/p>\n<h3>GCM ve FCM Nedir?<\/h3>\n<p>GCM (Google Cloud Messaging), Google taraf\u0131ndan geli\u015ftirilen ve geli\u015ftiricilerin sunucular\u0131ndan Android cihazlara bildirim mesajlar\u0131 g\u00f6ndermesine olanak tan\u0131yan \u00fccretsiz bir hizmetti. Ancak Google, 2016 y\u0131l\u0131nda GCM&#8217;nin yerini alacak olan Firebase Cloud Messaging (FCM) hizmetini duyurdu. FCM, GCM&#8217;nin t\u00fcm temel yeteneklerini bar\u0131nd\u0131rmakla kalmay\u0131p, ayn\u0131 zamanda daha zengin bir API, daha kolay entegrasyon ve iOS, Web gibi di\u011fer platformlara da destek sunarak daha kapsaml\u0131 bir \u00e7\u00f6z\u00fcm haline geldi. GCM, 2019 y\u0131l\u0131nda tamamen kullan\u0131mdan kald\u0131r\u0131ld\u0131, bu nedenle g\u00fcn\u00fcm\u00fczde push bildirimleri g\u00f6ndermek i\u00e7in Firebase Cloud Messaging (FCM) kullanmak zorunludur. Makalemizde GCM terimi ge\u00e7se de, t\u00fcm pratik uygulamalar\u0131m\u0131z\u0131 ve kod \u00f6rneklerimizi FCM \u00fczerinden ger\u00e7ekle\u015ftirece\u011fiz.<\/p>\n<p>FCM, temelde \u00fc\u00e7 ana bile\u015fenden olu\u015fur:<br \/>\n*   <strong>Client Uygulama:<\/strong> Android cihazlarda \u00e7al\u0131\u015fan mobil uygulaman\u0131z. FCM SDK&#8217;s\u0131n\u0131 i\u00e7erir.<br \/>\n*   <strong>FCM Backend:<\/strong> Google taraf\u0131ndan y\u00f6netilen ve mesajlar\u0131 y\u00f6nlendiren sunucu altyap\u0131s\u0131.<br \/>\n*   <strong>Uygulama Sunucusu (App Server):<\/strong> Bildirimleri g\u00f6ndermek istedi\u011finizde FCM backend&#8217;ine istek g\u00f6nderen kendi sunucunuz (bu makalede Python ile olu\u015fturaca\u011f\u0131m\u0131z sunucu).<\/p>\n<p>Bir bildirim g\u00f6nderme s\u00fcreci \u015fu ad\u0131mlar\u0131 takip eder:<br \/>\n1.  Android uygulamas\u0131 ilk kez ba\u015flat\u0131ld\u0131\u011f\u0131nda veya token&#8217;\u0131 de\u011fi\u015fti\u011finde, FCM SDK&#8217;s\u0131 cihaz i\u00e7in benzersiz bir &#8220;kay\u0131t token&#8217;\u0131&#8221; (registration token) al\u0131r.<br \/>\n2.  Bu kay\u0131t token&#8217;\u0131, uygulaman\u0131z taraf\u0131ndan kendi uygulama sunucunuza (Python sunucumuza) g\u00f6nderilir ve sunucunuzda saklan\u0131r.<br \/>\n3.  Uygulama sunucunuz bir bildirim g\u00f6ndermek istedi\u011finde, saklad\u0131\u011f\u0131 kay\u0131t token&#8217;lar\u0131n\u0131 kullanarak FCM backend&#8217;ine bir HTTP iste\u011fi g\u00f6nderir. Bu istek, bildirim ba\u015fl\u0131\u011f\u0131n\u0131, i\u00e7eri\u011fini ve di\u011fer iste\u011fe ba\u011fl\u0131 verileri i\u00e7erir.<br \/>\n4.  FCM backend&#8217;i, iste\u011fi al\u0131r, hedef cihaz\u0131n \u00e7evrimi\u00e7i olup olmad\u0131\u011f\u0131n\u0131 kontrol eder ve bildirimi uygun \u015fekilde cihaza y\u00f6nlendirir.<br \/>\n5.  Cihazdaki FCM SDK&#8217;s\u0131 bildirimi al\u0131r ve uygulaman\u0131za iletir. Uygulaman\u0131z bu bildirimi kullan\u0131c\u0131ya g\u00f6sterir veya arka planda i\u015fler.<\/p>\n<h3>\u00d6n Gereksinimler<\/h3>\n<p>Bu makaledeki ad\u0131mlar\u0131 takip edebilmek i\u00e7in a\u015fa\u011f\u0131daki \u00f6n gereksinimlere sahip olman\u0131z gerekmektedir:<\/p>\n<h4>Python Ortam\u0131<\/h4>\n<p>*   <strong>Python 3.x:<\/strong> Sisteminizde Python 3 y\u00fckl\u00fc olmal\u0131d\u0131r. Komut istemcinizde <code>python --version<\/code> veya <code>python3 --version<\/code> komutuyla kontrol edebilirsiniz.<br \/>\n*   <strong>pip:<\/strong> Python paket y\u00f6neticisi pip&#8217;in g\u00fcncel oldu\u011fundan emin olun. Genellikle Python kurulumuyla birlikte gelir.<\/p>\n<h4>Google Hesab\u0131 ve Firebase Projesi<\/h4>\n<p>*   <strong>Google Hesab\u0131:<\/strong> Bir Firebase projesi olu\u015fturmak ve y\u00f6netmek i\u00e7in aktif bir Google hesab\u0131na ihtiyac\u0131n\u0131z olacak.<br \/>\n*   <strong>Firebase Projesi:<\/strong> Firebase Console \u00fczerinden bir Firebase projesi olu\u015fturman\u0131z gerekecektir. Bu proje, Android uygulaman\u0131z\u0131 ve sunucunuzu FCM ile entegre etmek i\u00e7in kullan\u0131lacakt\u0131r.<\/p>\n<h4>Android Geli\u015ftirme Ortam\u0131<\/h4>\n<p>*   <strong>Android Studio:<\/strong> Android uygulamas\u0131 geli\u015ftirmek i\u00e7in Android Studio&#8217;nun kurulu olmas\u0131 gerekmektedir.<br \/>\n*   <strong>Temel Android Bilgisi:<\/strong> Android uygulamas\u0131 olu\u015fturma ve yap\u0131land\u0131rma hakk\u0131nda temel bilgilere sahip olman\u0131z faydal\u0131 olacakt\u0131r.<\/p>\n<h4>Gerekli K\u00fct\u00fcphaneler (Python)<\/h4>\n<p>Sunucu taraf\u0131nda push bildirimleri g\u00f6ndermek i\u00e7in Python&#8217;da \u00e7e\u015fitli k\u00fct\u00fcphaneler kullanabiliriz. Bu makalede, FCM HTTP v1 API ile do\u011frudan etkile\u015fim kurmak i\u00e7in <code>requests<\/code> k\u00fct\u00fcphanesini ve yetkilendirme i\u00e7in <code>google-auth<\/code> k\u00fct\u00fcphanesini kullanaca\u011f\u0131z. Ayr\u0131ca, token&#8217;lar\u0131 kaydetmek ve basit bir API sunmak i\u00e7in <code>Flask<\/code> web framework&#8217;\u00fcn\u00fc kullanaca\u011f\u0131z.<\/p>\n<p>Bu k\u00fct\u00fcphaneleri kurmak i\u00e7in terminalinizde a\u015fa\u011f\u0131daki komutlar\u0131 \u00e7al\u0131\u015ft\u0131r\u0131n:<\/p>\n<pre><code class=\"language-bash\">pip install requests google-auth Flask<\/code><\/pre>\n<p>Alternatif olarak, Google&#8217;\u0131n resmi Python SDK&#8217;s\u0131 olan <code>firebase-admin<\/code> k\u00fct\u00fcphanesini de kullanabilirsiniz. Bu k\u00fct\u00fcphane, FCM ile etkile\u015fimi daha y\u00fcksek seviyeli ve daha kolay hale getirir. Ancak, FCM HTTP v1 API&#8217;sinin nas\u0131l \u00e7al\u0131\u015ft\u0131\u011f\u0131n\u0131 anlamak ad\u0131na <code>requests<\/code> ile ilerleyece\u011fiz.<\/p>\n<h3>Android Uygulama Taraf\u0131 Kurulumu<\/h3>\n<p>Push bildirimlerini alabilmek i\u00e7in Android uygulaman\u0131zda baz\u0131 yap\u0131land\u0131rmalar yapman\u0131z gerekmektedir.<\/p>\n<h4>Firebase Projesi Olu\u015fturma ve Uygulama Ekleme<\/h4>\n<p>1.  <strong>Firebase Console&#8217;a Gitme:<\/strong> Taray\u0131c\u0131n\u0131zda [https:\/\/console.firebase.google.com\/](https:\/\/console.firebase.google.com\/) adresine gidin ve Google hesab\u0131n\u0131zla oturum a\u00e7\u0131n.<br \/>\n2.  <strong>Yeni Proje Olu\u015fturma:<\/strong> &#8220;Proje Ekle&#8221; butonuna t\u0131klayarak yeni bir Firebase projesi olu\u015fturun. Projenize bir isim verin ve gerekli ad\u0131mlar\u0131 takip edin. Google Analytics ayarlar\u0131n\u0131 iste\u011finize g\u00f6re yap\u0131land\u0131rabilirsiniz.<br \/>\n3.  <strong>Android Uygulamas\u0131 Ekleme:<\/strong> Projeniz olu\u015fturulduktan sonra, proje genel bak\u0131\u015f ekran\u0131nda &#8220;Uygulaman\u0131za Firebase ekleyin&#8221; b\u00f6l\u00fcm\u00fcnden Android simgesine t\u0131klay\u0131n.<br \/>\n4.  <strong>Uygulama Bilgilerini Girme:<\/strong><br \/>\n    *   <strong>Android Paket Ad\u0131:<\/strong> Android uygulaman\u0131z\u0131n <code>build.gradle<\/code> dosyas\u0131ndaki <code>applicationId<\/code> ile e\u015fle\u015fmelidir (\u00f6rne\u011fin, <code>com.example.myapp<\/code>).<br \/>\n    *   <strong>Uygulama Takma Ad\u0131 (iste\u011fe ba\u011fl\u0131):<\/strong> Uygulaman\u0131za bir isim verin.<br \/>\n    *   <strong>SHA-1 Sertifika Parmak \u0130zi (iste\u011fe ba\u011fl\u0131 ama \u00f6nerilir):<\/strong> Google Sign-In gibi hizmetleri kullanmay\u0131 planl\u0131yorsan\u0131z veya daha g\u00fcvenli bir kurulum i\u00e7in SHA-1 parmak izini eklemeniz \u00f6nerilir. Bu, uygulaman\u0131z\u0131n kimli\u011fini do\u011frulamak i\u00e7in kullan\u0131l\u0131r.<br \/>\n        *   Debug SHA-1&#8217;i almak i\u00e7in Android Studio&#8217;da sa\u011f \u00fcstteki Gradle sekmesini a\u00e7\u0131n, <code>app -> Tasks -> android -> signingReport<\/code> \u00f6\u011fesine \u00e7ift t\u0131klay\u0131n. \u00c7\u0131kt\u0131da <code>SHA1:<\/code> ile ba\u015flayan de\u011feri kopyalay\u0131n.<br \/>\n5.  <strong><code>google-services.json<\/code> Dosyas\u0131n\u0131 \u0130ndirme:<\/strong> Uygulama bilgilerinizi girdikten sonra Firebase, <code>google-services.json<\/code> adl\u0131 bir yap\u0131land\u0131rma dosyas\u0131 olu\u015fturacakt\u0131r. Bu dosyay\u0131 indirin ve Android Studio projenizin <code>app<\/code> mod\u00fcl\u00fcn\u00fcn k\u00f6k dizinine (genellikle <code>app\/<\/code> klas\u00f6r\u00fc) yap\u0131\u015ft\u0131r\u0131n.<\/p>\n<h4>Gradle Yap\u0131land\u0131rmas\u0131<\/h4>\n<p><code>google-services.json<\/code> dosyas\u0131n\u0131 ekledikten sonra, Firebase SDK&#8217;s\u0131n\u0131 ve Google Services eklentisini projenize dahil etmeniz gerekir.<\/p>\n<p>1.  <strong>Proje Seviyesindeki <code>build.gradle<\/code> (Project: YourProjectName) dosyas\u0131na ekleyin:<\/strong><\/p>\n<pre><code class=\"language-gradle\">buildscript {\n        repositories {\n            google()\n            mavenCentral()\n        }\n        dependencies {\n            \/\/ ... di\u011fer ba\u011f\u0131ml\u0131l\u0131klar\n            classpath 'com.google.gms:google-services:4.3.15' \/\/ En g\u00fcncel s\u00fcr\u00fcm\u00fc kullan\u0131n\n        }\n    }\n    \/\/ ...<\/code><\/pre>\n<p>2.  <strong>Uygulama Seviyesindeki <code>build.gradle<\/code> (Module: app) dosyas\u0131na ekleyin:<\/strong><\/p>\n<pre><code class=\"language-gradle\">plugins {\n        id 'com.android.application'\n        id 'com.google.gms.google-services' \/\/ Bu sat\u0131r\u0131 ekleyin\n    }\n\n    android {\n        \/\/ ...\n    }\n\n    dependencies {\n        \/\/ ... di\u011fer ba\u011f\u0131ml\u0131l\u0131klar\n        implementation 'com.google.firebase:firebase-bom:32.7.0' \/\/ En g\u00fcncel BOM s\u00fcr\u00fcm\u00fcn\u00fc kullan\u0131n\n        implementation 'com.google.firebase:firebase-messaging'\n    }<\/code><\/pre>\n<p>De\u011fi\u015fiklikleri uygulad\u0131ktan sonra Android Studio&#8217;da &#8220;Sync Project with Gradle Files&#8221; butonuna t\u0131klay\u0131n.<\/p>\n<h4>FCM Kay\u0131t Token&#8217;\u0131n\u0131 Alma<\/h4>\n<p>Her cihaz\u0131n, FCM ile ileti\u015fim kurmak i\u00e7in benzersiz bir kay\u0131t token&#8217;\u0131na ihtiyac\u0131 vard\u0131r. Bu token, cihaz\u0131n uygulaman\u0131z i\u00e7in FCM taraf\u0131ndan tan\u0131nmas\u0131n\u0131 sa\u011flar. Bu token&#8217;\u0131 almak ve sunucumuza g\u00f6ndermek i\u00e7in \u00f6zel bir servis olu\u015fturmal\u0131y\u0131z.<\/p>\n<p>1.  <strong><code>FirebaseMessagingService<\/code> Olu\u015fturma:<\/strong> Uygulaman\u0131zda <code>FirebaseMessagingService<\/code> s\u0131n\u0131f\u0131ndan t\u00fcreyen bir servis olu\u015fturun. Bu servis, yeni token&#8217;lar olu\u015fturuldu\u011funda veya mevcut token&#8217;lar yenilendi\u011finde tetiklenir.<\/p>\n<pre><code class=\"language-java\">package com.example.myapp;\n\n    import android.util.Log;\n    import com.google.firebase.messaging.FirebaseMessagingService;\n    import com.google.firebase.messaging.RemoteMessage;\n\n    public class MyFirebaseMessagingService extends FirebaseMessagingService {\n\n        private static final String TAG = \"MyFirebaseMsgService\";\n\n        @Override\n        public void onNewToken(String token) {\n            Log.d(TAG, \"Refreshed token: \" + token);\n\n            \/\/ TODO: Bu token'\u0131 kendi uygulama sunucunuza g\u00f6nderin.\n            \/\/ Genellikle bir HTTP POST iste\u011fi ile sunucuya g\u00f6nderilir\n            \/\/ ve sunucunuzda bir veritaban\u0131nda saklan\u0131r.\n            sendRegistrationToServer(token);\n        }\n\n        @Override\n        public void onMessageReceived(RemoteMessage remoteMessage) {\n            \/\/ Uygulama \u00f6n plandayken gelen mesajlar\u0131 burada i\u015fleyebilirsiniz.\n            Log.d(TAG, \"From: \" + remoteMessage.getFrom());\n\n            \/\/ Mesaj bir bildirim i\u00e7eriyorsa\n            if (remoteMessage.getNotification() != null) {\n                Log.d(TAG, \"Message Notification Body: \" + remoteMessage.getNotification().getBody());\n                \/\/ Burada bildirimi kullan\u0131c\u0131ya g\u00f6stermek i\u00e7in NotificationManager kullanabilirsiniz.\n                \/\/ \u00d6rne\u011fin: showNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());\n            }\n\n            \/\/ Mesaj veri i\u00e7eriyorsa (data payload)\n            if (remoteMessage.getData().size() > 0) {\n                Log.d(TAG, \"Message data payload: \" + remoteMessage.getData());\n                \/\/ Veri payload'\u0131n\u0131 burada i\u015fleyebilirsiniz.\n            }\n        }\n\n        private void sendRegistrationToServer(String token) {\n            \/\/ Bu metodda, token'\u0131 Python sunucumuza g\u00f6ndermek i\u00e7in bir HTTP iste\u011fi yapmal\u0131y\u0131z.\n            \/\/ \u00d6rne\u011fin, Volley veya Retrofit gibi k\u00fct\u00fcphaneler kullanarak bir POST iste\u011fi yapabilirsiniz.\n            \/\/ \u00d6rnek bir URL: \"http:\/\/your_python_server_ip:5000\/register_token\"\n            \/\/ requestBody: {\"token\": token}\n            Log.d(TAG, \"Sending token to server: \" + token);\n            \/\/ ... (HTTP iste\u011fi g\u00f6nderme kodu buraya gelecek)\n        }\n    }<\/code><\/pre>\n<p>2.  <strong><code>AndroidManifest.xml<\/code> Dosyas\u0131na Servisi Ekleme:<\/strong><\/p>\n<pre><code class=\"language-xml\"><application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap\/ic_launcher\"\n        android:label=\"@string\/app_name\"\n        android:roundIcon=\"@mipmap\/ic_launcher_round\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style\/Theme.MyApp\">\n\n        <!-- Di\u011fer aktiviteler ve servisler -->\n\n        <service\n            android:name=\".MyFirebaseMessagingService\"\n            android:exported=\"false\">\n            <intent-filter>\n                <action android:name=\"com.google.firebase.MESSAGING_EVENT\" \/>\n            <\/intent-filter>\n        <\/service>\n\n    <\/application><\/code><\/pre>\n<p>Art\u0131k uygulaman\u0131z her \u00e7al\u0131\u015ft\u0131\u011f\u0131nda veya token&#8217;\u0131 yenilendi\u011finde <code>onNewToken<\/code> metodu tetiklenecek ve logcat&#8217;te token&#8217;\u0131 g\u00f6receksiniz. Bu token&#8217;\u0131 <code>sendRegistrationToServer<\/code> metodunda kendi Python sunucunuza g\u00f6ndermeniz gerekecektir.<\/p>\n<h4>Bildirimleri Alma ve \u0130\u015fleme<\/h4>\n<p>*   <strong>Uygulama \u00d6n Plandayken:<\/strong> <code>onMessageReceived<\/code> metodu, uygulaman\u0131z \u00f6n plandayken bir bildirim geldi\u011finde tetiklenir. Bu durumda, bildirimi kullan\u0131c\u0131ya g\u00f6stermek i\u00e7in Android&#8217;in <code>NotificationManager<\/code> servisini kullanarak manuel olarak bir bildirim olu\u015fturman\u0131z gerekir.<br \/>\n*   <strong>Uygulama Arka Plandayken\/Kapal\u0131yken:<\/strong> Uygulaman\u0131z arka plandayken veya tamamen kapal\u0131yken gelen bildirimler, e\u011fer bildirim payload&#8217;u (notification payload) i\u00e7eriyorsa, FCM SDK&#8217;s\u0131 taraf\u0131ndan otomatik olarak sistem tepsisinde g\u00f6sterilir. Kullan\u0131c\u0131 bildirime t\u0131klad\u0131\u011f\u0131nda, uygulaman\u0131z ba\u015flat\u0131l\u0131r ve bildirimin i\u00e7erdi\u011fi verilerle (e\u011fer varsa) a\u00e7\u0131l\u0131r. E\u011fer sadece veri payload&#8217;u (data payload) g\u00f6nderilmi\u015fse, uygulama arka planda olsa bile <code>onMessageReceived<\/code> metodu \u00e7a\u011fr\u0131l\u0131r ve veriyi i\u015fleyebilirsiniz.<\/p>\n<h3>Python Sunucu Taraf\u0131 Kurulumu<\/h3>\n<p>\u015eimdi s\u0131ra, Android cihazlara bildirim g\u00f6nderecek olan Python sunucumuzu kurmaya geldi.<\/p>\n<h4>Gerekli K\u00fct\u00fcphaneler<\/h4>\n<p>Daha \u00f6nce belirtti\u011fimiz gibi, a\u015fa\u011f\u0131daki k\u00fct\u00fcphaneleri y\u00fckledi\u011finizden emin olun:<\/p>\n<pre><code class=\"language-bash\">pip install requests google-auth Flask<\/code><\/pre>\n<h4>Firebase Servis Hesab\u0131 Olu\u015fturma<\/h4>\n<p>Python sunucunuzun Firebase API&#8217;leri ile g\u00fcvenli bir \u015fekilde ileti\u015fim kurabilmesi i\u00e7in bir servis hesab\u0131 anahtar\u0131na ihtiyac\u0131 vard\u0131r. Bu anahtar, sunucunuzun kimli\u011fini do\u011frulamak i\u00e7in kullan\u0131l\u0131r.<\/p>\n<p>1.  <strong>Firebase Console&#8217;a Gitme:<\/strong> Projenizin Firebase Console&#8217;una gidin.<br \/>\n2.  <strong>Proje Ayarlar\u0131:<\/strong> Sol men\u00fcden &#8220;Proje Ayarlar\u0131&#8221; (Project settings) se\u00e7ene\u011fine t\u0131klay\u0131n.<br \/>\n3.  <strong>Servis Hesaplar\u0131 Sekmesi:<\/strong> &#8220;Servis Hesaplar\u0131&#8221; (Service accounts) sekmesine gidin.<br \/>\n4.  <strong>Yeni \u00d6zel Anahtar Olu\u015fturma:<\/strong> &#8220;Yeni \u00f6zel anahtar olu\u015ftur&#8221; (Generate new private key) d\u00fc\u011fmesine t\u0131klay\u0131n. Bu, bir JSON dosyas\u0131 indirecektir (\u00f6rne\u011fin, <code>your-project-name-firebase-adminsdk-xxxxx-xxxxxx.json<\/code>). Bu dosya, sunucunuzun kimlik bilgilerini i\u00e7erir ve kesinlikle gizli tutulmal\u0131d\u0131r. Bu dosyay\u0131 Python projenizin k\u00f6k dizinine yerle\u015ftirin.<\/p>\n<h4>API Anahtar\u0131 ve Yetkilendirme<\/h4>\n<p>FCM HTTP v1 API&#8217;si, geleneksel sunucu anahtar\u0131 yerine OAuth 2.0 token&#8217;lar\u0131 ile yetkilendirme kullan\u0131r. Bu token&#8217;lar\u0131 elde etmek i\u00e7in indirdi\u011finiz servis hesab\u0131 JSON dosyas\u0131n\u0131 kullanaca\u011f\u0131z. <code>google-auth<\/code> k\u00fct\u00fcphanesi bu s\u00fcreci kolayla\u015ft\u0131r\u0131r.<\/p>\n<pre><code class=\"language-python\">import os\nimport json\nimport requests\nfrom google.oauth2 import service_account\nfrom google.auth.transport.requests import Request\n\n<h2>Firebase servis hesab\u0131 anahtar\u0131n\u0131z\u0131n yolu<\/h2>\nSERVICE_ACCOUNT_KEY_FILE = 'path\/to\/your-project-name-firebase-adminsdk-xxxxx-xxxxxx.json'\nPROJECT_ID = 'your-firebase-project-id' # Firebase Console'dan proje kimli\u011finizi al\u0131n\n\ndef get_access_token():\n    \"\"\"\n    Firebase servis hesab\u0131 kimlik bilgileriyle bir eri\u015fim token'\u0131 al\u0131r.\n    \"\"\"\n    try:\n        credentials = service_account.Credentials.from_service_account_file(\n            SERVICE_ACCOUNT_KEY_FILE,\n            scopes=['https:\/\/www.googleapis.com\/auth\/firebase.messaging']\n        )\n        # Token'\u0131 yenilemek i\u00e7in Request nesnesini kullan\n        request = Request()\n        credentials.refresh(request)\n        return credentials.token\n    except Exception as e:\n        print(f\"Error getting access token: {e}\")\n        return None\n\n<h2>\u00d6rnek kullan\u0131m:<\/h2>\n<h2>access_token = get_access_token()<\/h2>\n<h2>if access_token:<\/h2>\n<h2>print(f\"Access Token: {access_token}\")<\/code><\/pre>\n<\/h2>\n<p><code>SERVICE_ACCOUNT_KEY_FILE<\/code> yolunu ve <code>PROJECT_ID<\/code> de\u011ferini kendi Firebase projenizin bilgileriyle g\u00fcncellemeyi unutmay\u0131n. <code>PROJECT_ID<\/code>&#8216;yi Firebase Console&#8217;da Proje Ayarlar\u0131 -> Genel sekmesinde bulabilirsiniz.<\/p>\n<h3>Python ile Push Bildirimi G\u00f6nderme<\/h3>\n<p>\u015eimdi, as\u0131l i\u015f olan Python sunucumuzdan Android cihazlara push bildirimi g\u00f6nderme i\u015flemine ge\u00e7elim.<\/p>\n<h4>Temel Mant\u0131k<\/h4>\n<p>1.  <strong>Token Saklama:<\/strong> Android uygulaman\u0131zdan gelen kay\u0131t token&#8217;lar\u0131n\u0131 sunucunuzda g\u00fcvenli bir \u015fekilde saklaman\u0131z gerekir. Ger\u00e7ek bir uygulamada bu bir veritaban\u0131 (PostgreSQL, MySQL, MongoDB vb.) olurdu. Basit bir \u00f6rnek i\u00e7in, bu makalede bir liste veya JSON dosyas\u0131 kullanabiliriz.<br \/>\n2.  <strong>Bildirim Y\u00fck\u00fc (Payload):<\/strong> FCM&#8217;ye g\u00f6nderdi\u011fimiz her bildirim, bir JSON nesnesi \u015feklinde bir y\u00fck i\u00e7erir. Bu y\u00fck iki ana b\u00f6l\u00fcmden olu\u015fabilir:<br \/>\n    *   <strong><code>notification<\/code>:<\/strong> Cihaz\u0131n sistem tepsisinde g\u00f6sterilecek ba\u015fl\u0131k (<code>title<\/code>) ve i\u00e7erik (<code>body<\/code>) gibi g\u00f6r\u00fcnen bilgileri i\u00e7erir.<br \/>\n    *   <strong><code>data<\/code>:<\/strong> Uygulaman\u0131z\u0131n arka planda i\u015fleyebilece\u011fi \u00f6zel verileri i\u00e7erir. Bu veriler anahtar-de\u011fer \u00e7iftleri \u015feklinde olabilir ve uygulaman\u0131z\u0131n belirli bir eylemi ger\u00e7ekle\u015ftirmesi i\u00e7in kullan\u0131labilir.<\/p>\n<h4>FCM HTTP v1 API Kullanarak G\u00f6nderme<\/h4>\n<p>FCM HTTP v1 API&#8217;si, bildirim g\u00f6ndermek i\u00e7in kullan\u0131lan en g\u00fcncel ve \u00f6nerilen y\u00f6ntemdir.<\/p>\n<p><strong>Endpoint URL&#8217;si:<\/strong><br \/>\n<code>https:\/\/fcm.googleapis.com\/v1\/projects\/{PROJECT_ID}\/messages:send<\/code><\/p>\n<p><strong>Gerekli HTTP Ba\u015fl\u0131klar\u0131:<\/strong><br \/>\n*   <code>Authorization: Bearer <ACCESS_TOKEN><\/code>: <code>get_access_token()<\/code> fonksiyonundan ald\u0131\u011f\u0131m\u0131z eri\u015fim token&#8217;\u0131.<br \/>\n*   <code>Content-Type: application\/json<\/code>: \u0130stek g\u00f6vdesinin JSON format\u0131nda oldu\u011funu belirtir.<\/p>\n<p><strong>JSON \u0130stek G\u00f6vdesi:<\/strong><br \/>\n\u0130stek g\u00f6vdesi, bir <code>message<\/code> objesi i\u00e7ermelidir. Bu <code>message<\/code> objesi, hedefleme (<code>token<\/code>, <code>topic<\/code>, <code>condition<\/code>), bildirim (<code>notification<\/code>) ve veri (<code>data<\/code>) alanlar\u0131n\u0131 i\u00e7erir.<\/p>\n<pre><code class=\"language-python\">import requests\nimport json\nfrom google.oauth2 import service_account\nfrom google.auth.transport.requests import Request\n\n<h2>Firebase servis hesab\u0131 anahtar\u0131n\u0131z\u0131n yolu ve proje kimli\u011finiz<\/h2>\nSERVICE_ACCOUNT_KEY_FILE = 'your-project-name-firebase-adminsdk-xxxxx-xxxxxx.json'\nPROJECT_ID = 'your-firebase-project-id'\n\ndef get_access_token():\n    \"\"\"\n    Firebase servis hesab\u0131 kimlik bilgileriyle bir eri\u015fim token'\u0131 al\u0131r.\n    \"\"\"\n    try:\n        credentials = service_account.Credentials.from_service_account_file(\n            SERVICE_ACCOUNT_KEY_FILE,\n            scopes=['https:\/\/www.googleapis.com\/auth\/firebase.messaging']\n        )\n        request = Request()\n        credentials.refresh(request)\n        return credentials.token\n    except Exception as e:\n        print(f\"Error getting access token: {e}\")\n        return None\n\ndef send_fcm_notification(registration_token, title, body, data=None):\n    \"\"\"\n    Belirtilen kay\u0131t token'\u0131na FCM bildirimi g\u00f6nderir.\n    \"\"\"\n    access_token = get_access_token()\n    if not access_token:\n        print(\"Failed to get access token. Cannot send notification.\")\n        return False\n\n    headers = {\n        'Authorization': f'Bearer {access_token}',\n        'Content-Type': 'application\/json'\n    }\n\n    message = {\n        'message': {\n            'token': registration_token,\n            'notification': {\n                'title': title,\n                'body': body,\n            },\n            'data': data if data else {}, # \u00d6zel veriler\n        }\n    }\n\n    fcm_send_url = f'https:\/\/fcm.googleapis.com\/v1\/projects\/{PROJECT_ID}\/messages:send'\n\n    try:\n        response = requests.post(fcm_send_url, headers=headers, data=json.dumps(message))\n        response.raise_for_status() # HTTP hata durumlar\u0131n\u0131 yakala (4xx veya 5xx)\n\n        print(f\"FCM response status: {response.status_code}\")\n        print(f\"FCM response body: {response.json()}\")\n        return True\n    except requests.exceptions.RequestException as e:\n        print(f\"Error sending FCM message: {e}\")\n        if response is not None:\n            print(f\"Response content: {response.text}\")\n        return False\n\n<h2># \u00d6rnek kullan\u0131m:<\/h2>\n<h2># Android uygulaman\u0131zdan ald\u0131\u011f\u0131n\u0131z bir kay\u0131t token'\u0131<\/h2>\n<h2>test_token = \"YOUR_ANDROID_DEVICE_REGISTRATION_TOKEN_HERE\"<\/h2>\n<h2># if send_fcm_notification(test_token, \"Merhaba Python!\", \"Bu bir Python sunucusundan gelen bildirimdir.\", {\"key\": \"value\"}):<\/h2>\n<h2>print(\"Bildirim ba\u015far\u0131yla g\u00f6nderildi.\")<\/h2>\n<h2>else:<\/h2>\n<h2>print(\"Bildirim g\u00f6nderilirken hata olu\u015ftu.\")<\/code><\/pre>\n<\/h2>\n<p>Bu kod par\u00e7as\u0131, <code>get_access_token<\/code> fonksiyonu ile bir eri\u015fim token&#8217;\u0131 al\u0131r ve ard\u0131ndan <code>send_fcm_notification<\/code> fonksiyonu ile belirtilen bir kay\u0131t token&#8217;\u0131na bildirim g\u00f6nderir. <code>data<\/code> parametresi ile \u00f6zel veriler de ekleyebilirsiniz.<\/p>\n<h4>\u00c7oklu Cihazlara G\u00f6nderme ve Konular (Topics)<\/h4>\n<p>Tek tek token&#8217;lara bildirim g\u00f6ndermenin yan\u0131 s\u0131ra, FCM daha esnek hedefleme se\u00e7enekleri sunar:<\/p>\n<p>*   <strong>\u00c7oklu Cihazlara Tek Tek G\u00f6nderme:<\/strong> E\u011fer bir\u00e7ok cihaza ayn\u0131 anda bildirim g\u00f6ndermek istiyorsan\u0131z, her bir token i\u00e7in ayr\u0131 ayr\u0131 <code>send_fcm_notification<\/code> fonksiyonunu \u00e7a\u011f\u0131rabilir veya FCM&#8217;nin toplu mesajla\u015fma (batch messaging) \u00f6zelli\u011fini kullanabilirsiniz (ancak bu, daha karma\u015f\u0131k bir API kullan\u0131m\u0131 gerektirir).<br \/>\n*   <strong>Konulara (Topics) G\u00f6nderme:<\/strong> Cihazlar\u0131n belirli konulara abone olmas\u0131n\u0131 sa\u011flayabilirsiniz (\u00f6rne\u011fin, &#8220;haberler&#8221;, &#8220;spor&#8221;). Bu durumda, bildirim g\u00f6nderirken <code>token<\/code> yerine <code>topic<\/code> alan\u0131n\u0131 kullan\u0131rs\u0131n\u0131z:<\/p>\n<pre><code class=\"language-json\">{\n      \"message\": {\n        \"topic\": \"news\",\n        \"notification\": {\n          \"title\": \"Son Dakika!\",\n          \"body\": \"Yeni bir haber yay\u0131nda.\"\n        }\n      }\n    }<\/code><\/pre>\n<p>    Android taraf\u0131nda bir cihaza konuya abone olmak i\u00e7in:<\/p>\n<pre><code class=\"language-java\">FirebaseMessaging.getInstance().subscribeToTopic(\"news\")\n        .addOnCompleteListener(task -> {\n            String msg = \"Subscribed to news topic\";\n            if (!task.isSuccessful()) {\n                msg = \"Subscribe failed\";\n            }\n            Log.d(TAG, msg);\n        });<\/code><\/pre>\n<p>*   <strong>Ko\u015fullara (Conditions) G\u00f6nderme:<\/strong> Daha karma\u015f\u0131k hedefleme i\u00e7in <code>condition<\/code> alan\u0131n\u0131 kullanabilirsiniz. Bu, birden fazla konuya abone olan veya belirli bir konuya abone olmayan cihazlara bildirim g\u00f6ndermenizi sa\u011flar:<\/p>\n<pre><code class=\"language-json\">{\n      \"message\": {\n        \"condition\": \"'stock' in topics && ('weather' in topics || 'news' in topics)\",\n        \"notification\": {\n          \"title\": \"\u00d6zel Bildirim\",\n          \"body\": \"Hisse senedi ve hava durumu\/haberler ile ilgilenenlere.\"\n        }\n      }\n    }<\/code><\/pre>\n<h4>Hata Y\u00f6netimi ve Yeniden Denemeler<\/h4>\n<p>FCM API&#8217;sinden gelen yan\u0131tlar\u0131 dikkatlice incelemek \u00f6nemlidir. Olas\u0131 hatalar \u015funlar\u0131 i\u00e7erebilir:<br \/>\n*   <strong><code>INVALID_ARGUMENT<\/code>:<\/strong> \u0130stek g\u00f6vdesi veya ba\u015fl\u0131klar\u0131nda bir hata var.<br \/>\n*   <strong><code>UNREGISTERED<\/code>:<\/strong> G\u00f6nderilen token art\u0131k ge\u00e7erli de\u011fil (cihaz uygulamay\u0131 kald\u0131rm\u0131\u015f veya token yenilenmi\u015f). Bu token&#8217;lar\u0131 veritaban\u0131n\u0131zdan silmeniz gerekir.<br \/>\n*   <strong><code>UNAVAILABLE<\/code>:<\/strong> Ge\u00e7ici bir FCM hatas\u0131. Belirli bir gecikmeyle yeniden deneme yapabilirsiniz (exponential backoff).<br \/>\n*   <strong><code>NOT_FOUND<\/code>:<\/strong> Belirtilen proje kimli\u011fi bulunamad\u0131.<\/p>\n<p><code>send_fcm_notification<\/code> fonksiyonumuzda <code>response.raise_for_status()<\/code> ile temel HTTP hatalar\u0131n\u0131 yakal\u0131yoruz. Daha detayl\u0131 hata y\u00f6netimi i\u00e7in <code>response.json()<\/code> i\u00e7eri\u011fini kontrol etmek ve belirli hata kodlar\u0131na g\u00f6re i\u015flem yapmak gerekir. Ge\u00e7ersiz token&#8217;lar\u0131 veritaban\u0131n\u0131zdan otomatik olarak temizlemek, gelecekteki bildirim g\u00f6nderme i\u015flemlerinizin verimlili\u011fini art\u0131racakt\u0131r.<\/p>\n<h3>Python Sunucusu \u00d6rne\u011fi (Flask ile Basit Bir API)<\/h3>\n<p>\u015eimdi t\u00fcm par\u00e7alar\u0131 bir araya getirerek, token&#8217;lar\u0131 kaydedebilen ve bildirim g\u00f6nderebilen basit bir Flask tabanl\u0131 sunucu olu\u015ftural\u0131m.<\/p>\n<pre><code class=\"language-python\">from flask import Flask, request, jsonify\nimport json\nimport os\nimport requests\nfrom google.oauth2 import service_account\nfrom google.auth.transport.requests import Request\n\napp = Flask(__name__)\n\n<h2>--- FCM Yetkilendirme ve G\u00f6nderme Fonksiyonlar\u0131 ---<\/h2>\n<h2>Firebase servis hesab\u0131 anahtar\u0131n\u0131z\u0131n yolu ve proje kimli\u011finiz<\/h2>\n<h2>G\u00fcvenlik i\u00e7in bu bilgileri ortam de\u011fi\u015fkenlerinden veya g\u00fcvenli bir yap\u0131land\u0131rma dosyas\u0131ndan okuyun.<\/h2>\n<h2>\u00d6rnek: os.environ.get('FIREBASE_SERVICE_ACCOUNT_KEY_PATH')<\/h2>\nSERVICE_ACCOUNT_KEY_FILE = 'your-project-name-firebase-adminsdk-xxxxx-xxxxxx.json'\nPROJECT_ID = 'your-firebase-project-id'\n\n<h2>Token'lar\u0131 saklamak i\u00e7in basit bir liste. Ger\u00e7ek uygulamada bir veritaban\u0131 kullanmal\u0131s\u0131n\u0131z.<\/h2>\n<h2>Bu liste, sunucu yeniden ba\u015flat\u0131ld\u0131\u011f\u0131nda s\u0131f\u0131rlanacakt\u0131r.<\/h2>\nregistered_tokens = []\n\n<h2>Token'lar\u0131 kal\u0131c\u0131 olarak saklamak i\u00e7in basit bir JSON dosyas\u0131 kullanal\u0131m<\/h2>\nTOKEN_FILE = 'registered_tokens.json'\n\ndef load_tokens():\n    if os.path.exists(TOKEN_FILE):\n        with open(TOKEN_FILE, 'r') as f:\n            return json.load(f)\n    return []\n\ndef save_tokens(tokens):\n    with open(TOKEN_FILE, 'w') as f:\n        json.dump(tokens, f)\n\nregistered_tokens = load_tokens()\n\ndef get_access_token():\n    try:\n        credentials = service_account.Credentials.from_service_account_file(\n            SERVICE_ACCOUNT_KEY_FILE,\n            scopes=['https:\/\/www.googleapis.com\/auth\/firebase.messaging']\n        )\n        request = Request()\n        credentials.refresh(request)\n        return credentials.token\n    except Exception as e:\n        print(f\"Error getting access token: {e}\")\n        return None\n\ndef send_fcm_notification(registration_token, title, body, data=None):\n    access_token = get_access_token()\n    if not access_token:\n        print(\"Failed to get access token. Cannot send notification.\")\n        return False\n\n    headers = {\n        'Authorization': f'Bearer {access_token}',\n        'Content-Type': 'application\/json'\n    }\n\n    message = {\n        'message': {\n            'token': registration_token,\n            'notification': {\n                'title': title,\n                'body': body,\n            },\n            'data': data if data else {},\n        }\n    }\n\n    fcm_send_url = f'https:\/\/fcm.googleapis.com\/v1\/projects\/{PROJECT_ID}\/messages:send'\n\n    try:\n        response = requests.post(fcm_send_url, headers=headers, data=json.dumps(message))\n        response.raise_for_status()\n\n        response_data = response.json()\n        print(f\"FCM response status: {response.status_code}\")\n        print(f\"FCM response body: {response_data}\")\n\n        # Hata durumlar\u0131n\u0131 kontrol et ve ge\u00e7ersiz token'lar\u0131 sil\n        if 'error' in response_data:\n            error_code = response_data['error'].get('status')\n            if error_code == 'UNREGISTERED' or error_code == 'NOT_FOUND':\n                print(f\"Token {registration_token} is invalid or unregistered. Removing from list.\")\n                global registered_tokens\n                registered_tokens = [t for t in registered_tokens if t != registration_token]\n                save_tokens(registered_tokens)\n                return False\n        return True\n    except requests.exceptions.RequestException as e:\n        print(f\"Error sending FCM message to {registration_token}: {e}\")\n        if response is not None:\n            print(f\"Response content: {response.text}\")\n        return False\n\n<h2>--- Flask API Endpoints ---<\/h2>\n\n@app.route('\/')\ndef home():\n    return \"FCM Push Notification Server is running!\"\n\n@app.route('\/register_token', methods=['POST'])\ndef register_token():\n    \"\"\"\n    Android cihazlardan gelen FCM kay\u0131t token'lar\u0131n\u0131 kaydeder.\n    \u0130stek g\u00f6vdesi: {\"token\": \"cihaz_token_buraya\"}\n    \"\"\"\n    token_data = request.get_json()\n    if not token_data or 'token' not in token_data:\n        return jsonify({\"error\": \"Token missing\"}), 400\n\n    token = token_data['token']\n    if token not in registered_tokens:\n        registered_tokens.append(token)\n        save_tokens(registered_tokens)\n        print(f\"Token registered: {token}\")\n        return jsonify({\"message\": \"Token registered successfully\"}), 200\n    else:\n        print(f\"Token already registered: {token}\")\n        return jsonify({\"message\": \"Token already registered\"}), 200\n\n@app.route('\/send_notification', methods=['POST'])\ndef send_notification():\n    \"\"\"\n    Kay\u0131tl\u0131 t\u00fcm cihazlara push bildirimi g\u00f6nderir.\n    \u0130stek g\u00f6vdesi: {\"title\": \"Bildirim Ba\u015fl\u0131\u011f\u0131\", \"body\": \"Bildirim \u0130\u00e7eri\u011fi\", \"data\": {\"key\": \"value\"}}\n    \"\"\"\n    notification_data = request.get_json()\n    if not notification_data or 'title' not in notification_data or 'body' not in notification_data:\n        return jsonify({\"error\": \"Title or body missing\"}), 400\n\n    title = notification_data['title']\n    body = notification_data['body']\n    data = notification_data.get('data', {})\n\n    if not registered_tokens:\n        return jsonify({\"message\": \"No tokens registered to send notifications\"}), 200\n\n    success_count = 0\n    failure_count = 0\n    for token in list(registered_tokens): # Liste \u00fczerinde de\u011fi\u015fiklik yaparken kopyas\u0131n\u0131 kullan\n        if send_fcm_notification(token, title, body, data):\n            success_count += 1\n        else:\n            failure_count += 1\n            # send_fcm_notification zaten ge\u00e7ersiz token'lar\u0131 listeden siliyor.\n\n    return jsonify({\n        \"message\": f\"Notifications sent. Success: {success_count}, Failure: {failure_count}\",\n        \"total_tokens_after_send\": len(registered_tokens)\n    }), 200\n\nif __name__ == '__main__':\n    # Flask uygulamas\u0131n\u0131 \u00e7al\u0131\u015ft\u0131rma\n    # Debug modunu \u00fcretim ortam\u0131nda KAPALI tutun!\n    app.run(host='0.0.0.0', port=5000, debug=True)<\/code><\/pre>\n<p><strong>Kullan\u0131m Notlar\u0131:<\/strong><br \/>\n1.  <code>SERVICE_ACCOUNT_KEY_FILE<\/code> ve <code>PROJECT_ID<\/code> de\u011fi\u015fkenlerini kendi Firebase projenizin de\u011ferleriyle g\u00fcncelleyin. Servis hesab\u0131 JSON dosyas\u0131n\u0131n sunucunuzla ayn\u0131 dizinde oldu\u011fundan emin olun veya do\u011fru yolu belirtin.<br \/>\n2.  Bu \u00f6rnekte token&#8217;lar\u0131 basit bir JSON dosyas\u0131na kaydediyoruz. Ger\u00e7ek bir uygulamada, \u00f6l\u00e7eklenebilirlik ve g\u00fcvenlik i\u00e7in bir veritaban\u0131 kullanmal\u0131s\u0131n\u0131z.<br \/>\n3.  Uygulamay\u0131 \u00e7al\u0131\u015ft\u0131rmak i\u00e7in terminalinizde <code>python your_server_file_name.py<\/code> komutunu kullan\u0131n. Sunucu varsay\u0131lan olarak <code>http:\/\/0.0.0.0:5000<\/code> adresinde \u00e7al\u0131\u015facakt\u0131r.<br \/>\n4.  Android uygulaman\u0131zdan <code>\/register_token<\/code> endpoint&#8217;ine POST iste\u011fi g\u00f6ndererek token&#8217;lar\u0131 kaydedin.<br \/>\n5.  <code>send_notification<\/code> endpoint&#8217;ine POST iste\u011fi g\u00f6ndererek kay\u0131tl\u0131 t\u00fcm cihazlara bildirim g\u00f6nderin.<\/p>\n<p><strong>\u00d6rnek API \u0130stekleri (Postman\/cURL ile):<\/strong><\/p>\n<p>*   <strong>Token Kayd\u0131:<\/strong><\/p>\n<pre><code class=\"language-bash\">curl -X POST -H \"Content-Type: application\/json\" -d '{\"token\": \"YOUR_ANDROID_DEVICE_REGISTRATION_TOKEN\"}' http:\/\/YOUR_SERVER_IP:5000\/register_token<\/code><\/pre>\n<p>*   <strong>Bildirim G\u00f6nderme:<\/strong><\/p>\n<pre><code class=\"language-bash\">curl -X POST -H \"Content-Type: application\/json\" -d '{\"title\": \"Yeni Bildirim!\", \"body\": \"Uygulaman\u0131zdan \u00f6nemli bir mesaj.\", \"data\": {\"type\": \"promo\", \"id\": \"123\"}}' http:\/\/YOUR_SERVER_IP:5000\/send_notification<\/code><\/pre>\n<h3>G\u00fcvenlik ve En \u0130yi Uygulamalar<\/h3>\n<p>Push bildirim sunucusu geli\u015ftirirken g\u00fcvenlik ve performans, dikkat edilmesi gereken kritik noktalard\u0131r.<\/p>\n<p>*   <strong>API Anahtarlar\u0131n\u0131n G\u00fcvenli\u011fi:<\/strong> Firebase servis hesab\u0131 JSON dosyan\u0131z ve di\u011fer API anahtarlar\u0131n\u0131z son derece gizli tutulmal\u0131d\u0131r.<br \/>\n    *   Bu dosyay\u0131 asla istemci taraf\u0131nda (Android uygulamas\u0131 i\u00e7inde) kullanmay\u0131n.<br \/>\n    *   Versiyon kontrol sistemlerine (Git gibi) do\u011frudan y\u00fcklemekten ka\u00e7\u0131n\u0131n. <code>.gitignore<\/code> dosyas\u0131na ekleyin.<br \/>\n    *   \u00dcretim ortam\u0131nda, bu t\u00fcr hassas bilgileri ortam de\u011fi\u015fkenleri, bulut tabanl\u0131 gizli y\u00f6netim hizmetleri (\u00f6rne\u011fin, Google Secret Manager, AWS Secrets Manager) veya \u015fifrelenmi\u015f yap\u0131land\u0131rma dosyalar\u0131 arac\u0131l\u0131\u011f\u0131yla y\u00f6netin.<br \/>\n*   <strong>Token Y\u00f6netimi:<\/strong><br \/>\n    *   <strong>Ge\u00e7ersiz Token&#8217;lar\u0131 Temizleme:<\/strong> FCM API&#8217;si bir token&#8217;\u0131n ge\u00e7ersiz oldu\u011funu veya art\u0131k kay\u0131tl\u0131 olmad\u0131\u011f\u0131n\u0131 bildirdi\u011finde (\u00f6rne\u011fin, <code>UNREGISTERED<\/code> hatas\u0131), bu token&#8217;\u0131 veritaban\u0131n\u0131zdan derhal silmelisiniz. Bu, gereksiz API \u00e7a\u011fr\u0131lar\u0131n\u0131 \u00f6nler ve sisteminizin performans\u0131n\u0131 art\u0131r\u0131r.<br \/>\n    *   <strong>Token G\u00fcncelleme:<\/strong> Cihaz\u0131n kay\u0131t token&#8217;\u0131 zaman zaman de\u011fi\u015febilir. <code>onNewToken<\/code> metodu tetiklendi\u011finde, yeni token&#8217;\u0131 sunucunuza g\u00f6ndererek mevcut token&#8217;\u0131 g\u00fcncellemeniz veya yerine yenisini eklemeniz gerekir.<br \/>\n    *   <strong>G\u00fcvenli Saklama:<\/strong> Token&#8217;lar\u0131 veritaban\u0131n\u0131zda g\u00fcvenli bir \u015fekilde saklay\u0131n.<br \/>\n*   <strong>Veri Gizlili\u011fi ve Hassasiyet:<\/strong><br \/>\n    *   Hassas ki\u015fisel bilgileri veya gizli verileri do\u011frudan bildirim payload&#8217;unda g\u00f6ndermekten ka\u00e7\u0131n\u0131n. Bunun yerine, bir kimlik (ID) g\u00f6nderin ve uygulaman\u0131n bu kimli\u011fi kullanarak sunucunuzdan g\u00fcvenli bir API \u00e7a\u011fr\u0131s\u0131 ile veriyi \u00e7ekmesini sa\u011flay\u0131n.<br \/>\n*   <strong>H\u0131z S\u0131n\u0131rlar\u0131 (Rate Limiting):<\/strong> FCM, belirli h\u0131z s\u0131n\u0131rlar\u0131na sahiptir. \u00c7ok say\u0131da bildirim g\u00f6nderiyorsan\u0131z, bu s\u0131n\u0131rlar\u0131 a\u015fmamaya dikkat edin. Toplu bildirimler i\u00e7in FCM&#8217;nin destekledi\u011fi y\u00f6ntemleri kullanmak veya kendi taraf\u0131n\u0131zda bir kuyruk sistemi (\u00f6rne\u011fin, Celery ile Redis\/RabbitMQ) kurarak bildirim g\u00f6nderme i\u015flemlerini yava\u015flatmak faydal\u0131 olabilir.<br \/>\n*   <strong>Hata \u0130zleme ve G\u00fcnl\u00fck Kayd\u0131:<\/strong> Bildirim g\u00f6nderme i\u015flemlerindeki ba\u015far\u0131 ve ba\u015far\u0131s\u0131zl\u0131klar\u0131 izleyin. Hata g\u00fcnl\u00fcklerini tutarak sorunlar\u0131 h\u0131zl\u0131 bir \u015fekilde tespit edebilir ve \u00e7\u00f6zebilirsiniz.<br \/>\n*   <strong>Sunucu G\u00fcvenli\u011fi:<\/strong> Flask uygulaman\u0131z\u0131 \u00fcretim ortam\u0131nda \u00e7al\u0131\u015ft\u0131r\u0131rken bir WSGI sunucusu (Gunicorn, uWSGI) arkas\u0131nda \u00e7al\u0131\u015ft\u0131rmal\u0131 ve bir ters proxy (Nginx, Apache) ile korumal\u0131s\u0131n\u0131z. G\u00fcvenlik duvarlar\u0131, SSL\/TLS \u015fifrelemesi ve di\u011fer standart sunucu g\u00fcvenli\u011fi uygulamalar\u0131n\u0131 uygulay\u0131n.<\/p>\n<h3>Sonu\u00e7<\/h3>\n<p>Bu makalede, Python kullanarak Android cihazlara Firebase Cloud Messaging (FCM) arac\u0131l\u0131\u011f\u0131yla push bildirimleri g\u00f6ndermek i\u00e7in bir sunucu olu\u015fturma s\u00fcrecini ayr\u0131nt\u0131l\u0131 olarak inceledik. GCM&#8217;den FCM&#8217;ye ge\u00e7i\u015fi, Android uygulama taraf\u0131nda yap\u0131lmas\u0131 gereken yap\u0131land\u0131rmalar\u0131, kay\u0131t token&#8217;lar\u0131n\u0131n nas\u0131l al\u0131naca\u011f\u0131n\u0131 ve sunucuya nas\u0131l g\u00f6nderilece\u011fini \u00f6\u011frendik. Ard\u0131ndan, Python sunucumuzda Firebase servis hesab\u0131 yetkilendirmesini ve FCM HTTP v1 API&#8217;sini kullanarak bildirim g\u00f6nderme mekanizmas\u0131n\u0131 ad\u0131m ad\u0131m uygulad\u0131k. Son olarak, Flask framework&#8217;\u00fc ile basit bir API sunucusu \u00f6rne\u011fi olu\u015fturarak token kayd\u0131 ve bildirim g\u00f6nderme i\u015flevlerini bir araya getirdik ve \u00f6nemli g\u00fcvenlik ve en iyi uygulamalar hakk\u0131nda bilgi verdik.<\/p>\n<p>Art\u0131k, uygulaman\u0131z\u0131n kullan\u0131c\u0131lar\u0131yla etkile\u015fimi art\u0131rmak, \u00f6nemli g\u00fcncellemeleri an\u0131nda iletmek veya hedeflenmi\u015f pazarlama kampanyalar\u0131 y\u00fcr\u00fctmek i\u00e7in g\u00fc\u00e7l\u00fc bir push bildirim altyap\u0131s\u0131na sahipsiniz. Bu temel yap\u0131y\u0131 kullanarak, daha geli\u015fmi\u015f hedefleme, bildirim zamanlama, \u00e7oklu platform deste\u011fi ve daha sa\u011flam hata y\u00f6netimi gibi \u00f6zellikleri entegre ederek uygulaman\u0131z\u0131n bildirim yeteneklerini daha da geni\u015fletebilirsiniz. Unutmay\u0131n, push bildirimlerinin g\u00fcc\u00fcn\u00fc ak\u0131ll\u0131ca ve kullan\u0131c\u0131 deneyimini zenginle\u015ftirecek \u015fekilde kullanmak, uygulaman\u0131z\u0131n ba\u015far\u0131s\u0131 i\u00e7in kritik \u00f6neme sahiptir.<\/body><\/p>\n","protected":false},"excerpt":{"rendered":"Python ile GCM (Google Cloud Messaging) Kullanarak Android Cihazlara Push Bildirimleri G\u00f6nderme Sunucusu Olu\u015fturma\nPush bildirimleri, mobil uygulam","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_page_header_type":"","csco_page_load_nextpost":"","csco_page_subscribe_form":"","csco_page_contact_form":"","footnotes":""},"categories":[1341],"tags":[],"class_list":{"0":"post-34849","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-cloud","7":"cs-entry","8":"cs-video-wrap"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.5 (Yoast SEO v25.3.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python ile GCM (Google Cloud Messaging) Kullanarak Android Cihazlara Push Bildirimleri G\u00f6nderme Sunucusu Olu\u015fturma - Kodlar\u0131n Gizemli D\u00fcnyas\u0131<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python ile GCM (Google Cloud Messaging) Kullanarak Android Cihazlara Push Bildirimleri G\u00f6nderme Sunucusu Olu\u015fturma\" \/>\n<meta property=\"og:description\" content=\"Python ile GCM (Google Cloud Messaging) Kullanarak Android Cihazlara Push Bildirimleri G\u00f6nderme Sunucusu Olu\u015fturma Push bildirimleri, mobil uygulam\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/\" \/>\n<meta property=\"og:site_name\" content=\"Kodlar\u0131n Gizemli D\u00fcnyas\u0131\" \/>\n<meta property=\"article:published_time\" content=\"2025-11-22T17:41:03+00:00\" \/>\n<meta name=\"author\" content=\"Fatih Soysal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fatih Soysal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"23 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/\"},\"author\":{\"name\":\"Fatih Soysal\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"headline\":\"Python ile GCM (Google Cloud Messaging) Kullanarak Android Cihazlara Push Bildirimleri G\u00f6nderme Sunucusu Olu\u015fturma\",\"datePublished\":\"2025-11-22T17:41:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/\"},\"wordCount\":2919,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"articleSection\":[\"Cloud\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/#respond\"]}],\"copyrightYear\":\"2025\",\"copyrightHolder\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/\",\"name\":\"Python ile GCM (Google Cloud Messaging) Kullanarak Android Cihazlara Push Bildirimleri G\u00f6nderme Sunucusu Olu\u015fturma - Kodlar\u0131n Gizemli D\u00fcnyas\u0131\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\"},\"datePublished\":\"2025-11-22T17:41:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Anasayfa\",\"item\":\"https:\/\/fatihsoysal.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python ile GCM (Google Cloud Messaging) Kullanarak Android Cihazlara Push Bildirimleri G\u00f6nderme Sunucusu Olu\u015fturma\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/\",\"name\":\"Fatihsoysal.com\",\"description\":\"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim\",\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\",\"name\":\"Fatih Soysal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"contentUrl\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"width\":512,\"height\":512,\"caption\":\"Fatih Soysal\"},\"logo\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\"},\"description\":\"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python ile GCM (Google Cloud Messaging) Kullanarak Android Cihazlara Push Bildirimleri G\u00f6nderme Sunucusu Olu\u015fturma - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/","og_locale":"tr_TR","og_type":"article","og_title":"Python ile GCM (Google Cloud Messaging) Kullanarak Android Cihazlara Push Bildirimleri G\u00f6nderme Sunucusu Olu\u015fturma","og_description":"Python ile GCM (Google Cloud Messaging) Kullanarak Android Cihazlara Push Bildirimleri G\u00f6nderme Sunucusu Olu\u015fturma Push bildirimleri, mobil uygulam","og_url":"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/","og_site_name":"Kodlar\u0131n Gizemli D\u00fcnyas\u0131","article_published_time":"2025-11-22T17:41:03+00:00","author":"Fatih Soysal","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"Fatih Soysal","Tahmini okuma s\u00fcresi":"23 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/#article","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/"},"author":{"name":"Fatih Soysal","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"headline":"Python ile GCM (Google Cloud Messaging) Kullanarak Android Cihazlara Push Bildirimleri G\u00f6nderme Sunucusu Olu\u015fturma","datePublished":"2025-11-22T17:41:03+00:00","mainEntityOfPage":{"@id":"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/"},"wordCount":2919,"commentCount":0,"publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"articleSection":["Cloud"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/#respond"]}],"copyrightYear":"2025","copyrightHolder":{"@id":"https:\/\/fatihsoysal.com\/blog\/#organization"}},{"@type":"WebPage","@id":"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/","url":"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/","name":"Python ile GCM (Google Cloud Messaging) Kullanarak Android Cihazlara Push Bildirimleri G\u00f6nderme Sunucusu Olu\u015fturma - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/#website"},"datePublished":"2025-11-22T17:41:03+00:00","breadcrumb":{"@id":"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/fatihsoysal.com\/blog\/python-ile-gcm-google-cloud-messaging-kullanarak-android-cihazlara-push-bildirimleri-gonderme-sunucusu-olusturma\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Anasayfa","item":"https:\/\/fatihsoysal.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Python ile GCM (Google Cloud Messaging) Kullanarak Android Cihazlara Push Bildirimleri G\u00f6nderme Sunucusu Olu\u015fturma"}]},{"@type":"WebSite","@id":"https:\/\/fatihsoysal.com\/blog\/#website","url":"https:\/\/fatihsoysal.com\/blog\/","name":"Fatihsoysal.com","description":"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim","publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1","name":"Fatih Soysal","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","contentUrl":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","width":512,"height":512,"caption":"Fatih Soysal"},"logo":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/"},"description":"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.","url":"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/"}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/34849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/comments?post=34849"}],"version-history":[{"count":1,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/34849\/revisions"}],"predecessor-version":[{"id":34850,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/34849\/revisions\/34850"}],"wp:attachment":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/media?parent=34849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/categories?post=34849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/tags?post=34849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}