Updating Android Manifest XML | Gamooga

Updating Android Manifest XML

  1. Add dependencies to app/build.gradle:
    1. compile "com.google.android.gms:play-services:8.1.0"
    2. compile project(':gamooga-targetact-client-release')
    Our library requires Google Play Services hence we are adding it as a dependency. Remember to add it only if it is not already included.
  2. If you would like to receive push notifications add the following lines in app/src/main/AndroidManifest.xml outside the tag:
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
  3. If you would like to send events and receive mobile/push notifications add the following lines in app/src/main/AndroidManifest.xml outside the tag:
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  4. Add the following lines in app/src/main/AndroidManifest.xml inside the tag:
    <meta-data android:name="GAMOOGA_GCM_SENDER_ID" android:value="id:YOUR_SENDER_ID" />
    <meta-data android:name="GAMOOGA_COMPANY_ID" android:value="YOUR_COMPANY_ID" />
  5. To receive push notifications add the following lines in app/src/main/AndroidManifest.xml inside the tag:
    <receiver
     android:name="com.google.android.gms.gcm.GcmReceiver"
     android:exported="true"
     android:permission="com.google.android.c2dm.permission.SEND" />
      <intent-filter>
       <action android:name="com.google.android.c2dm.intent.RECEIVE" />
       <category android:name="Your_app_id" />
       </intent-filter>
    </receiver>
    <service
     android:name="com.gamooga.targetact.client.GamoogaGcmListenerService"
      android:exported="false" />
        <intent-filter>
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
       </intent-filter>
    </service>
    <service
     android:name="com.gamooga.targetact.client.GamoogaInstanceIDListenerService"
     android:exported="false">
       <intent-filter>
        <action android:name="com.google.android.gms.iid.InstanceID"/>
      </intent-filter>
    </service>
    <activity
      android:name="com.gamooga.targetact.client.GcmActivityShower"
      android:label="Loading"
      android:exported="true">
    </activity>
    <service
      android:name="com.gamooga.targetact.client.RegistrationIntentService"
      android:exported="false">
    </service>