Sending a push notification to android device using amazon sns - google-cloud-messaging

i already follow the instruction given http://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html#registration-id-gcm. But my created app didnt received any notification.
Can someone shed light on me.

You have:
Installed the Android SDK
Installed the Google Play Services SDK
Installed the Android Support Library package
Registered your app with GCM to receive push notification message
(you have a registration ID)
If not, start at http://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html.

Related

Configure expo notifications for push notifications

I have 2 apps and I implemented expo push notification and everything was fine, but in the other one it asked me for the experienceid as a prop to Notifications.getExpoPushTokenAsync({
experienceId: "#name/slug,
});
and when trying to send a notification it gives me this error: InvalidCredentials: Unable to retrieve the FCM server key for the recipient's app. Make sure you have provided a server key as directed by the Expo FCM documentation.
I dont want to use FCM, i want to use expo push api.
Can you help me?
The Expo Push API uses FCM for Android, and while it's not necessary to configure it for Expo Go (this is done already for the Expo Go app), when you deploy your standalone app you will need to have it configured for FCM. More information here: https://docs.expo.dev/push-notifications/using-fcm/

Will an Android app only receive push notifications is the app was downloaded from the Google Play Store? (React Native Expo)

I'm using Expo push notifications. Push notifications work fine in Expo Go and for apps on published to the Google Play store. But when I create an APK file and download it directly onto my Android phone, NOT through the Google Play store, the push notifications I send are not received.
Will push notifications only work for apps published to the Google Play store? Or is there a way to receive push notifications for apps downloaded directly onto an Android phone without being published to the Google Play store?
Depending on your android version and rom you have to open the app setting's (for me long press app icon).
Select settings
Choose notifications
Enable notification for this app
I forgot to import { Platform } from 'react-native'.
Also, I needed to upload Android server api key credentials which can be found in Firebase Console in your project settings under Cloud Messaging. Here is how to upload the server api key credentials in the terminal:
expo push:android:upload --api-key <your-token-here>
Documentation can be found here under "Uploading Server Credentials": https://docs.expo.dev/push-notifications/using-fcm/

React native FCM push notifications not working in IOS Adhoc and TestFlight

Trying to implement push notification in a react native app using google cloud messaging. The notification works perfectly on android device in a simulator and in production. But for IOS, it works only locally only when its ran in a device. In adhoc or test flight, it does not work. I am using the APN key. Anyone faced the same issue? I can see a lot of posts in stack overflow regarding push notification not working for ios but none of the post were helpful for me.
Here's what I have done till now:
Generated an APN Authentication Key in developer.apple.com
Added that key to ios App in firebase.console.google.com
Run the app in a device using xcode - (Push notification works fine everytime.)
Archive the app in xcode and distribute to AdHoc and install the .ipa file in a device. (Push notification does not work)
Distribute to testflight and test the push notification - does not work
Why would it work in debug mode and not in adhoc or testflight.
I checked this:https://stackoverflow.com/a/48111671/8729976 . It says there is a single auth token for both production and development environment so I am guessing its definitely not the key.
Here are the sample responses:
When the push notification is delivered we get status 200 with this message: projects/myproject-name/messages/1602538922793273
When the push notification is not delivered, we still get status 200 with this message: projects/myproject-name/messages/0:1602541135340865%6b2d5f5c6b2d5f5c
Don't know what the second message means.

not able to receive push notification on ios device

I am implementing react-native-firebase to my app
i have followed steps from official document(https://rnfirebase.io/docs/v5.x.x/installation/ios) as well as some other similar blogs (https://medium.com/#anum.amin/react-native-integrating-push-notifications-using-fcm-349fff071591),
but I am not able to receive any notification on my real device,
I followed all steps excepts generating key's, ID, and provisioning as I had already these while publishing my app
i have tried to send a notification from firebase console like below
and from postman
it shows succeed but no notification on the real device
i have also tried with oneSignal it was showing some apns 3000 error with my device as below
I have tried below solutions like
1 changing search header path
2 link binary with library
3 re-creating provisioning profile
but nothing worked
I am expecting to just receive my first push notification I am
struggling from last three days please help.
the step i follow to integrate firebase are below,
1 Create ios Firebase Project and add the googleservice-info.plist into my project on the final step firebase was able to connect with my app as below SS
2 Install Native Firebase Core and Firebase Messaging Libraries (pods)
3 Install and Link react native firebase lib
4 i had already a key for APNs generated so i upload the .p8 file in firebase messaging setting with key ID and Team ID
5 i had already provisioning profiles which i generated at the time of app publish
6 finally i add pushnotification and remote capabilities and add some code in appdelegate h&m files as suggested in documentation
Updating XCode from 9.4 to 10.1 helped me to solve my issue
the issue was with some of my provisioning profile downloaded earlier
I had already published the same code with some UI changes with XCode 9.4 but I never receive any suggestions/warning from apple
but this time when I publish the app with updated XCode 10.1 I received below email from Apple which gave me the right direction to find the solutions
then i follow the below answer
Missing Push Notification Entitlement
and solve my issue by delete the all Provisioning profile on my local machine, then re-download and install the Provisioning profile from the Provisioning Portal.

What could cause ti.cloud to stop display Android Push Notifications (GCM) in status bar

I previously setup an Appcelerator Titanium project with push notifications (as per my Stack Overflow question How to configure Android Push Notifications (GCM) in Appcelerator Titanium Dashboard?) and for some months my Android app has been receiving the appropriate push notification from GCM, but I'm now receiving reports that this no longer works from end-users.
The flow usually goes like this...
Android app sends android push token to my Java server
Java server persists the Android push token
Java server sets up Amazon Web Service SNS endpoint for GCM and stores this endpoint for later use.
(some time passes)
Java server invokes Amazon Web Service SNS endpoint with a GCM payload
Amazon SNS passes message to Google GCM
GCM passes message to ti.cloud / ti.cloudpush
Phone displays push notification
The app does receive the push notification and I display an application dialog to show the contents of the message, but NO system-tray push notification is displayed, whereas I thought it was doing this in the past. No system sound is played either.
I can see that if the app is not running, then when the push notification is received the app is launched, but if the display isn't on (or locked) then the message will not be discovered for some time. I really need the native/system push notification to be in the tray.
Does anyone know why system / status notifications are not displayed? Should it be when using the ti.cloud / ti.cloudpush for Android?
Thanks
Rob.