Test GCM push using Urban Airship fails silently - google-cloud-messaging

I'm updating my Android app to use the new Urban Airship library which supports Google Cloud Messaging.
I did the following:
Sign up for a GCM API key.
Go to Settings : Services : Configure GCM, add the API key and put in the package name for our app.
Update the client library from 1.1.3 to 3.0.0 (yes, I know, ouch!)
Take the project number from the API-console dashboard (this is a 12-digit integer) and add it to airshipconfig.properties like so:
transport = gcm
gcmSender = [project-number]
Remove these lines from airshipconfig.properties:
transport = c2dm
c2dmSender = [our email]
Add a log line on receiving a notification with intent PushManager.ACTION_REGISTRATION_FINISHED that prints out:
logger.w("Registration complete. APID: " + intent.getStringExtra(PushManager.EXTRA_APID) + ". Valid: " + intent.getBooleanExtra(PushManager.EXTRA_REGISTRATION_VALID, false));
The ACTION_REGISTRATION_FINISHED notification is coming back with what appears to be a valid APID. When I look it up in Urban Airship I can confirm that it's there:
APID
83014cb8-a573-45f9-9265-b95a8e21e7df
Alias
XDVRKQZ5WOGH
Active
True
Created
2 minutes ago
Tags
Phone, USA, PDT Group 7, PDT, HTC Glacier, App Version internal-4.4-b1, API 10, eng, receivesWeeklySpinTheWheelNotifications
C2DM Registration ID
None
But when I trigger a notification to this APID using the UA "Test Notification" console, the device never receives it (no log messages or user-visible notifications are generated indicating an incoming push) and no errors show up in the UA console. How can I debug from here?
EDIT: actually, some devices receive my test notifications (when I send them with that procedure), and some do not. I cannot discern any difference in the APID lookup. The devices which successfully receive are a phone running Android 2.3.3, a tablet running 3.1 and two phones running Android 4.1.1. The devices where it fails are a tablet running 4.0.3 and a phone running 2.3.4.

Related

no valid “aps-environment” entitlement string found for application error when implementing FCM

When attempting to implement Firebase Cloud Messaging into my application, I am receiving the following error at runtime:
I am receiving an FCM token, so it appears to be establishing a connection with firebase. I have read many suggestions on what the problem could be, many seem to indicate that there is a problem with my provisioning profile not allowing push notifications. I have checked these settings under "Signing & Capabilities" and it appears that the profile allows for push notifications, and has the aps-environment value in the entitlements section:
Is there something else I'm missing?
Here is my development environment:
macOS 10.15 (Catalina)
Xcode 11.5
iPad Air 2 (test deployment device)
I finally found the answer. Although my provisioning profile states that I have the aps-environment entitlement, and that I have Push Notification capability included, I STILL had to enable push notifications manually in the project. Additionally, the Background Modes (Remote notifications) capability needed to be added as well. These menus have changed in recent versions of xcode (for instance, the capabilities menu is now called signing and capabilities, and the add capability button is nestled up above all the settings).
In Xcode 11.5, follow these steps:
Click on your workspace name
Select your project in the target list
Select Signing & Capabilities
Click the +Capability button
Add Push Notifications and Background Modes (Remote notifications) from the list.

Firebase Cloud Messaging : behavior for unused smartphones

We are using Firebase to push notification to our users.
Here is the statistics when trying to send a notification to 1000 users that have stopped using our app since 2015 :
Android NotRegistered 566
Android success 181
IOS NotRegistered 253
It is obvious that almost 100% of such old users should not be not reachable. (That would mean they have our app still installed in their device without having opened it for 5 years).
Statistic for IOS look good.
But as for Android, there are >20% of tokens for which we receive a successful respons which is unrealistic
I suspect the following reason :
When someone has definitely stopped using their device without having removed the app (a new device was bought and the old one was thrown into a drawer), Google still believe it is alive.
Can you confirm, this is the case. If yes, do you know if Google will end up detecting the device is no more in use (with probability 99.9%), maybe if it fails to send our notification after some days ?
Actually, it is useful to have a relevant estimation of how many users I can reach with push notifications.

Mobilefirst Push Notification doesn't work if app closed

I'm working with MF CLI version 7.1. I've used Push Notification Sample from Mobile first and everything is going fine, but In my case I'm able to subscribe and receive push notifications.
But when I close the app I'm not able to receive push notification once I open the app the notification appears. The adapter message returned is with a positive result.
my device : Api level 6.
the project :
https://github.com/vivinkrishnan/multi-line-push
API level 6 translates to Android 2.0.1 which is not supported in MobileFirst. Try again in newer devices such as those starting with API level 10 (Android 2.2).

MobileFirst 7.1 - Issue with multiple Push Notification for Android devices after upgrade to MFP 7.1.0.00.20151227-1725

When I send multiple notifications to Apple or Android devices through MFP, Apple devices will display all notifications in the notifications center on the other hand Android will only display one last notification. We are using Unicast Notification to send messages to user devices using this REST API.
Initially my issue got fixed when I implemented solution given in this thread.
But after upgrading to MFP 7.1.0.00.20151227-1725 I started facing the issue again.
It it a known limitation that the attribute gets removed from the file upon re-build, since a re-build re-generates the file...
You need to add it back after a re-build. It is scheduled to be enhanced in the future so this won't be needed.
For now you can use for example an Ant task to replace the wlclient.properties file post-build with a version that contains again the attribute.

Does GCM works for android 2.3 platform?

I have created a APP using GCM which works correctly on Android platform 4.1 and 4.03 (I.e. Gets a RegId and register itself in my server and can even recieve a GCM), but when I start the emulator for android 2.3 (API 10) then the app gets installed but never registered I.E never gets RegId. When I start (install) the application for the first time then it receives a GCM message which I do not understand where it comes from but I can see that the device is not registered in my server. I also used a HTC phone with 2.3.3 android software and stil same result. Can any one see what the problem might be?
On the emulator it should normally not work, because it will not have a google account tied to the device. It is requiered for a device to have a google account and Google Play installed to register for an id.
The phone on the other hand should work.
GCM will Work from Android 2.2.
Refer this tutorial it may help you,
http://androidv5.wordpress.com/2012/08/15/how-to-implement-google-cloud-messaging/
it works fine for me.