Installation - Mozgoid/unity-gcm GitHub Wiki

Installation

  1. Download unitypackage from here
  2. Import unity-gcm.unitypackage into your Unity project
  3. Open Assets/Plugins/Android/AndroidManifest.xml and replace INPUT_YOUR_BUNDLE_IDENTIFIER with your bundle identifier
    • The default bundle identifier "com.Company.ProductName" is not available!
  4. Get Project Number in Google API Console
  5. Integrate parse plugin https://parse.com/docs/unity_guide
  6. Add object with script ParseNotifications to scene and change some values in it (like project number and bundle id).
  7. Set up parse for ios and android
  8. Send your push.

Show notification view in Android status bar

You can send simple message from parse. Also you can custumize it by sending json with fields

  • ticker
  • content_title
  • alert

You can do this by switching message type on parse's new notification page from plain text to json and sending something like this:

{
    "alert" : "Your message",
    "ticker" : "ticker",
    "content_title" : "content_title",
    "otherField" : "thi string will not appear but you can try to cath it from your game"
}

FAQ

Q. I have already used Assets/Plugins/Android/AndroidManifest.xml in my project

In order to use your AndroidManifest.xml, copy and paste the following two blocks into your AndroidManifest.xml (Of course replace INPUT_YOUR_BUNDLE_IDENTIFIER with your bundle identifier)

    <!-- Android GCM Plugin -->
    <permission android:name="INPUT_YOUR_BUNDLE_IDENTIFIER.permission.C2D_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="INPUT_YOUR_BUNDLE_IDENTIFIER.permission.C2D_MESSAGE" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <!-- Android GCM Plugin -->
        <!-- Android GCM Plugin -->
        <receiver android:name="com.kskkbys.unitygcmplugin.UnityGCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                <category android:name="INPUT_YOUR_BUNDLE_IDENTIFIER" />
            </intent-filter>
        </receiver>
        <service android:name="com.kskkbys.unitygcmplugin.UnityGCMIntentService" />
        <!-- Android GCM Plugin -->
⚠️ **GitHub.com Fallback** ⚠️