Migrating to FCM and Teak 2.0

GCM was deprecated April 10, 2018, and will be removed “as soon as April 11, 2019” according to Google.


The Teak SDK no longer supports GCM, but we’re going to make your migration to FCM as painless as possible.

Don’t Panic

  • It’s going to be ok
  • All of the push tokens Teak has collected will keep working
  • You don’t have to let Google collect analytics
  • You can always ask us for help

Import your GCM project as a Firebase project

Follow Google’s instructions to import your project to Firebase.


You only need to perform the Import your GCM project as a Firebase project step of those instructions.

This doc describes everything else you need to do.

Your live game will continue to work after this step, this step just adds Firebase, so there will not be a disruption in service.

Update to at least AIR 29

If you are using a lower version of AIR, you’ll need to update to AIR 29.


Remove these permissions from your AIR App:

<permission android:name="YOUR_BUNDLE_ID.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
<uses-permission android:name="YOUR_BUNDLE_ID.permission.C2D_MESSAGE"/>

But make sure you keep:

<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

It is required by older versions of Google Play services to create IID tokens.

Add Your Firebase App Id

Add your Firebase App Id to the section where you configure your Teak values, it should look something like this:

 <meta-data android:name="io_teak_app_id" android:value="teakYOUR_TEAK_APP_ID" />
 <meta-data android:name="io_teak_api_key" android:value="teakYOUR_TEAK_API_KEY" />
 <meta-data android:name="io_teak_gcm_sender_id" android:value="teakYOUR_GCM_SENDER_ID" />
 <meta-data android:name="io_teak_firebase_app_id" android:value="teakYOUR_FIREBASE_APP_ID" />


Replace YOUR_FIREBASE_APP_ID with your Firebase App Id.

(How to find this value)


Make sure to keep the ‘teak’ prefix on each value, I.E. teak12345.

Change the Teak Receiver

Right now you will have something which looks like this:

 <receiver android:name="io.teak.sdk.Teak"
         <action android:name="YOUR_BUNDLE_ID.intent.TEAK_NOTIFICATION_OPENED" />
         <action android:name="YOUR_BUNDLE_ID.intent.TEAK_NOTIFICATION_CLEARED" />
         <action android:name="com.google.android.c2dm.intent.RECEIVE" />
         <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
         <category android:name="YOUR_BUNDLE_ID" />

Remove the highlighted lines, so that you have:

<receiver android:name="io.teak.sdk.Teak" android:exported="false">
        <action android:name="YOUR_BUNDLE_ID.intent.TEAK_NOTIFICATION_OPENED" />
        <action android:name="YOUR_BUNDLE_ID.intent.TEAK_NOTIFICATION_CLEARED" />
        <category android:name="YOUR_BUNDLE_ID" />

Add the Teak FCM Service

Add the following service:

<service android:name="io.teak.sdk.push.FCMPushProvider"
        <action android:name="com.google.firebase.MESSAGING_EVENT" />
        <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />

Add the Firebase Job Dispatcher Service

Add the following service:

    android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE" >
        <action android:name="com.google.android.gms.gcm.ACTION_TASK_READY" />

Update your Dependencies

Finally, you’ll need to update your dependencies.

FCM and GCM dependencies cannot live alongside each other, so remove your GCM dependencies, and make sure that any other SDKs you use do not rely on GCM.

The new dependencies, as well as suggested ANEs can be found here: Android Dependencies.

Optionally Disable Google’s Automatic Analytics Collection

Don’t want to send your purchase and session data to Google? You don’t have to!

Add this line to your Android XML:

<meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" />