i've setup push notification for Android and IOS in new project in Appcelerator studio , the IOS working fine , but the android not , my issue is the android devices token is successfully taken and registered but when i send a push from Appcelerator studio IOS success when Android failed.
I've enabled this API's in google developer console .
and created API key :
and i used the API key in Appcelerator ASC :
i don't understand why i can take the Android device token but i am not able to send push notification ?
i found the solution the document of appcelerator is not updated yet
so here what you have to do
try the following sample code for devices registration :
https://gist.github.com/MotiurRahman/68bb7aad307901805b5f
Then Configuring push services for Android devices :
http://docs.appcelerator.com/platform/latest/#!/guide/Configuring_push_services-section-37551713_Configuringpushservices-ConfiguringpushservicesforAndroiddevices
With Firebase WEB API KEY
and project ID
https://console.firebase.google.com/?pli=1
Get project_number (as Sender ID ) from JSON file and Web API KEY( as GCM API key ) from your firebase console.Now configure your dashboard for push notification
http://docs.appcelerator.com/platform/latest/#!/guide/Sending_and_Scheduling_Push_Notifications
Related
We have developed a hybrid application using MobileFirst 7.1.0 and are looking to implement push notifications. With the recent changes regarding GCM to FCM, I'm wondering if it would be possible to add the project to FCM and use the API Key and Sender ID? I have seen the documentation has been updated for MobileFirst 8.0 and wondering if the same will work on 7.1.0.
The documentation has indeed did not yet get updated for 7.1, but it is the same as for 8.0 (the part of registering the project in FCM Console and obtaining the key and senderId), so you can follow the same instructions.
Visit the Firebase Console.
Create a new project and provide a project name.
Click on the Settings “cog wheel” icon and select Project settings.
Click the Cloud Messaging tab to generate a Server API Key and a Sender ID and click Save.
Getting "Widevine DRM not supported on this device" exception when pushing a notification from AWS SNS to Android Emulator.
Steps followed
Developed Android mobile app and running in Android Emulator API 19
Registered my APP in Firebase of Google Cloud and can send notification to my mobile app from Firebase console.
Registered in AWS Cloud and SNS Service.
Downloaded java code from SNS Sample Application and provided all details required form GCM + Android
Used SNSMobilePush.java class to push sample notifications (SampleMessageGenerator.getSampleAndroidMessage()) to my running mobile emulator app
No notification found in Android.
Checked Android logs and found "Widevine DRM not supported on this device
android.media.UnsupportedSchemeException: Failed to instantiate drm object."
exception.
Any idea about this issue?
Notification doesn't work for emulators. We have to run the app on actual device to test notifications.
I am trying to integrate Urban Airship Push notification service in my android project.I have created a new project in google developer console and created a GCM server key.I added that GCM key in Urban Airship configuration as well,but it fails to send the notification.
The Urban Airship Error Console throws an error like
Received push with invalid authorization on platform GCM error message
I already created a test project in google developer console 2 months back, and having a valid GCM key. If I integrate this key in UA it works fine. But If I create a new server key in same project that is not working.
API key 4 is recently created but it is not working the Server Key created on June 9th works fine. Is this because the key is auto generated? If that is the issue, how do I auto-create the GCM server key?
Recently, I heard that GCM is migrating to Firebase. Do I need to use FCM key instead of GCM?
Seems that Google is no longer authorizing the API Keys created by Google API Console. I had a similar issue with Amazon SNS, and managed to fix it by using the Firebase auto-generated server key.
1 - Login into Google Firebase console, with the same credentials you used for Google API Console.
2 - Create a new project (or import an existing one).
3 - Click on the gear icon and select Project Settings
4 - Select CLOUD MESSAGING tab.
There you will see both the API Server Key and the Project number (which is needed in the application). This API Server key is the one you need to introduce in the Push Provider console (Urban Airship in your case).
I signed up for a Bluemix account in the US-South region and created a CF mobile app to use the Push Notification Service. Added the GCM credentials to the push configuration, cloned both the Cordova and Android HelloPush sample apps from the ibm-bluemix-mobile-services repository and setup the App ID and App Routes in the index.js file (for Cordova) and the MainActivity class (for Android).
Followed the instructions in Android helloPush Sample Application for Bluemix Mobile Services and HelloPush Cordova application for IBM MobileFirst Services on IBM Bluemix for both the Android and Cordova apps respectively.
Although both the apps successfully register at the imfpush server and the token is received with the device id, the push messages sent via the Push Dashboard are not received by the apps.
Tried changing the GCM credentials, but no luck in resolving the issue.
I confirmed that the devices were registered in the Push Service by querying
https://imfpush.ng.bluemix.net/imfpush/v1/apps/{applicationId}/devices/
which returned the registered Device IDs.
Specifically, I noticed that registerNotificationsCallback() in the Cordova app does not get fired at any time.
We have recently pushed a number of updates to both our Android Push SDK and our Cordova Push SDK that hopefully have helped resolve this issue. We have also published an update to the Android Hello Push sample that I would recommend retrying at this point.
Additionally please ensure the following
That you are not using other push notification-related plugins in your Cordova project (phonegap for example) as these will cause conflicting behavior
Your test device has access to the internet and can access Bluemix domains
Your GCM credentials are push enabled and properly configured
So I'm on a team working on a cross-platform app using GCM.
The Android and iOS Team each has it's own GCM Sender ID and Server API Key.
Each platform can register and get a token.
Each platform can successfully use GCM to talk to matching hardware : iOS -> iOS and Android -> Android...
The problem is we can't talk cross platform iOS -> Android and vice versa!?!? I get a "MismatchSenderId"...
What am I missing?
I've tried using the Android Sender ID to register on iOS and that won't let me register...
So I'm at a loss as to how I'm suppose to use GCM to talk from iOS -> Android?
Any Help??
SenderID in GCM by definition (here):
A unique numerical value created when you configure your API project
(given as "Project Number" in the Google Developers Console). The
sender ID is used in the registration process to identify an app
server that is permitted to send messages to the client app.
You can spot it in Developer Console at the top left corner besides the options list (API & Auth etc...)
This error is thrown because this SenderID does not match with the API key for the project. Meaning you are probably using the API key from another project and using another project number (SenderID). Please check that you are using the right values at right places.
About implementing GCM for cross-platform communication is fairly simple since it is now available to iOS by API. If that's not working out for you there are third party libraries to help with it as well.
Useful resources:
GCM iOS implementation
Cordova Plugin for PushNotification