Push notification OnMesssage() not called when received message

0 votes
I have issue during received push notifiction on android device send seuccessfully push notification on server but not able to received notification on my device my onMessage() method not called .
asked Jul 31, 2015 in App42 Cloud API-BaaS by Unity3d Ibex (10 points)
recategorized Aug 13, 2015 by sushil

1 Answer

0 votes

Hi,

Can you please share more information, so that we can trace the exact problem you are facing like :

  • Are you sample application, Or You have integrated in your application?
  • Please also provide application logs as well.

There may be a possibility that AndroidManifest.xml is not properly integrated.So also share the AndroidManifest.xml file.

Thanks & Regards

Vishnu Garg

answered Jul 31, 2015 by Vishnu Garg (674 points)
I am using sample application and using same source code provided in sample


manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.test.push"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />
 <!-- For customize with your app change below lines 11 and 13 "com.test.push".with your app package name-->
    <permission
        android:name="com.test.push.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />
    <uses-permission android:name="com.test.push.permission.C2D_MESSAGE" />
   
    <!-- This app has permission to register and receive data message. -->
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <!-- GCM requires a Google account. -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.VIBRATE" />
    

    <application
        android:icon="@drawable/app_icon"
        android:label="@string/app_name" >
         <activity android:name="com.unity3d.player.UnityPlayerActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="portrait">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
       
        <receiver
            android:name="com.shephertz.app42.push.plugin.App42GCMReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>

                <!-- Receives the actual messages. -->
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <!-- Receives the registration id. -->
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                 <!-- For customize with your app change below line 51 "com.test.push".with your app package name-->
                <category android:name="com.test.push" />
            </intent-filter>
        </receiver>

        <!--
          Application-specific subclass of GCMBaseIntentService that will
          handle received messages.

          By default, it must be named .GCMIntentService, unless the
          application uses a custom BroadcastReceiver that redefines its name.

        -->
       <service android:name="com.shephertz.app42.push.plugin.App42GCMService" >
        <!-- Defined Activity when Meesage is opened-->
        </service>
          <meta-data android:name="push_title" android:value="App42PushUnity"/>
           <meta-data
            android:name="com.google.android.gms.version"
            android:value="6587000" />
            <meta-data
            android:name="onMessageOpen"
            android:value="com.unity3d.player.UnityPlayerActivity" />
    </application>

</manifest>
Please also share Push Logs from AppHQ console, that will help to trace the problem. Have you submitted the server key in Android Setting option.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...