Custom push lib cannot receive notification

0 votes
Hello, I got problem with push service, when i use default lib "app42pushservice.jar" it's work fine, but i want to custom something (way to show title and content text of notification), then i build a custom lib (from source plugin) and my device no longer receive notification. I tested build new "app42pushservice.jar" without modify anything, my device still not receive notification and V2 lib "app42pushserviceV2.jar" not work too.
asked Aug 1, 2016 in Unity by copangtnc (45 points)

3 Answers

0 votes

Hi Copangtnc,

Greetings!!!

Yes, you can configure it by modifying plugin source attached with the sample. You can change your Notification UI and message format. We have added app42pushserviceV2.jar file in case if you don't want to show the message on Notification Bar if the application is opened.

There may be some issue in AndroidManifest.XML configuration due to which you are not able to receive Push Notifications. Please share your app AndroidManifest.xml file, so that I can help you in a better manner.

You can also share Push Logs available under Push Logs section of Unified Notification section on AppHQ Management Console. If you have not enabled it yet, then please click on AppManger>Settings and click on Enable button under Push Logs option.

P.S Please share the requested details, it will help us to find the root cause of this issue.

Thanks

Vishnu Garg

answered Aug 1, 2016 by Vishnu Garg (674 points)
edited Aug 1, 2016 by shepAdmin
0 votes

Thanks for fast answer!

My AndroidManifest.xml work with default lib.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.cp.testfe" android:versionCode="1" android:versionName="1.0">
  <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="23" />
  <!-- For customize with your app change below lines 11 and 13 "com.test.push".with your app package name-->
  <permission android:name="com.cp.testfe.permission.C2D_MESSAGE" android:protectionLevel="signature" />
  <uses-permission android:name="com.cp.testfe.permission.C2D_MESSAGE" />
  <uses-permission android:name="android.permission.GET_TASKS" />
  <!-- 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.cp.testfe" />
      </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="TestPush" />
    <meta-data android:name="com.google.android.gms.version" android:value="6587000" />
    <meta-data android:name="onMessageOpen" android:value="com.unity3d.player.UnityPlayerActivity" />
    <activity android:name="com.facebook.unity.FBUnityLoginActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
    <activity android:name="com.facebook.unity.FBUnityDialogsActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
    <activity android:name="com.facebook.unity.FBUnityAppLinkActivity" android:exported="true" />
    <activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true" />
    <activity android:name="com.facebook.unity.FBUnityGameRequestActivity" />
    <activity android:name="com.facebook.unity.FBUnityCreateGameGroupActivity" />
    <activity android:name="com.facebook.unity.FBUnityJoinGameGroupActivity" />
    <activity android:name="com.facebook.unity.AppInviteDialogActivity" />
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="fbappid" />
    <provider android:name="com.facebook.FacebookContentProvider" android:authorities="com.facebook.app.FacebookContentProviderid" android:exported="true" />
  </application>
</manifest>

And push log:

Message Sent to  device: APA91bHIpmF7T3JCz-cUCfv5G5aCh8uJaUKg0xcCn2lZzwHWkunkihcfFII7Hthl2PQvum5wq-efMBCHgrYY_zORK-dcrlp3u8-L_XeInLwdbIqv81xDxk4 : [ messageId=0:1470024349106137%f3555145f9fd7ecd ]
answered Aug 1, 2016 by copangtnc (45 points)
If you are building the same library without changing will you please share the logcat logs so that we can validate you are receiving Push message or not as its sent by dashboard.
0 votes
I dont know why now it's work like charm, but thank you very much for nice support!
answered Aug 1, 2016 by copangtnc (45 points)
Let me know If more queries are concern.
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
...