Not Receiving Any Push Notifications Using Unity 3D

I have followed all the documentations to send Push Notifications using Unity 3D, but still I am not able to receive any Push Notification in my Android devices.

I have checked the Error Console, it is empty.

Any help will be appreciated. 

 

Unity Version: 5.4.2f2

Urban Airship Unity Plugin Version: 3.3.1

Channel ID: 23bfb5ba-85f1-4ab1-9a7e-80b83737f5ae

Push ID: 7c8bd527-834c-4a68-9b6c-4b021f9a559a

 

Didn't find what you were looking for?

New post

Comments

8 comments

  • Hi Kevin,

    It looks like you input the new Server Key.

    Go ahead and input the Legacy Server Key instead into the Certificate portion of the Quick Start Guide, and give that a shot. Once you've done that and redeployed your app, you should be able to receive push from there.

    Comment actions Permalink
    0
  • Hi Michael,

     

    Thank you for your reply.

    I replaced the API Key with the Legacy Server Key from Firebase. Then I rebuilt the app and sent notifications a few times, but I still did not receive any Notifications in my devices.

    Comment actions Permalink
    0
  • Kevin,

    Did you happen to get your Channel ID after redeploying it to your device? If you can send that over I can take a look at our logs to see whats going on.

    Also, if you haven't already, you may try fully uninstalling the app from your device before redeploying it to your device to see if that fixes any issues.

    Comment actions Permalink
    0
  • Michael,

    I already tried fully uninstalling the app, then installing it. It didn't fix anything.

    I have the new Channel ID: ac815df5-d1e2-4699-a90e-b5d4910311b6

    And if you need the Push ID: 4aaa0272-3a70-44d1-a1aa-fa183f3df9c4

     

    I was also checking the ADB Logcat for my device, and I found these 2 errors. These might be the reason, but I don't know how to fix them. Please check.

    Saw this when I tried to send a Message from the Quickstart Guide keeping the app open:

    "

    UALib: Unable to register with GCM: The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 9877000 but found 8115000.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

    "

     

    Saw this when I tried to close the app:

    "

    UALib: GCM is unavailable. Unable to register for push notifications. If using the modular Google Play Services dependencies, make sure the application includes the com.google.android.gms:play-services-gcm dependency.

    "

    Comment actions Permalink
    0
  • Hey Michael,

    I realised the second error was not there previously, it started appearing after I made some changes to fix the first error. So, I'll recreate the project.

    So please check a solution for the first error.

    And here is a Channel id for another device, which has the previous version of the app: 

    1791bbdb-8679-47c7-b7d7-b6b7610cecfa

    Thanks.

    Comment actions Permalink
    0
  • Kevin,

    What changes are you making to the app to resolve the second error? Are you modifying the Android Manifest in any way?

    Comment actions Permalink
    0
  • Hey Michael,

    Thanks for all the replies. I am finally able to fix the problem. I just created an empty Unity project and imported the Urban Airship plugin and setup the basic Settings. And it's working! I realise now that I should have done this much earlier.

    So I believe the reason of the problem was:

    At the beginning, I had another 3rd party plugin in my Unity project, and that plugin was using Google Play Services. So when I imported the Urban Airship plugin in the project, the Android Manifests somehow got messed up.

    I still need to find a solution for the problem, because I'll need the other plugin in my project as well.

     

    Comment actions Permalink
    0
  • Kevin,

    The Google Play Services Resolver is likely the culprit behind some of the dependency errors, so changing that may help resolve the issue with other plugins.

    Try the following:

    As a first step, you might try matching the bundled jar and aar dependencies that the project below is using. To prevent the Google Jar Resolver from automatically adding or replacing the dependencies, you will need to disable background resolution. 

    Your dependencies might look like:

    Instead, make them match the following:

    If you have the Android SDK installed on your computer, you may be able to browse to your local Android SDK directory and manually replace the dependencies. For example:

     

    Comment actions Permalink
    0

Please sign in to leave a comment.