ionic push notification issues and solutions
IOS Push Notification
- For ios push notification, Must Install cocoapods(https://cocoapods.org/) to use firebase notification
- Must install phonegap-plugin-push after run
pod setup, so usually dorm -r pluginsand doionic cordova build iosagain - For ios notification
- You must specify
SENDER_IDinside config.xml
- You must specify
- For ios notification
- You must need a paid apple account to enable push notification on apple’s developer portal
- For ios notification
- You must generate certificates for dev/prod on apple developer portal’s
identifier->Push Notificationselection
- You must generate certificates for dev/prod on apple developer portal’s
- For ios notification, if you use Google’s
fcmnotification- You must set up the
APNs Certificates(upload .p12 format Certificates) at Firebase PortalCloud Messaging->iOS app configuration - To generate p12 file, you need to import cert files into your keychain app and export as p12 file.
- You must set up the
AWS SNS Configuration
Amazon SNS -> Mobile: Push notifications -> Create Platform application
- Application name
- Push notification platform: FCM
- API key: Google FCM API KEY
Publish Message, Sample message body
Android:
1
2
3{
"GCM": "{ \"data\": { \"message\": \"Sample message for Android endpoints\" } }"
}IOS:
1
2
3{
"GCM": "{ \"notification\": { \"text\": \"test message\",\"body\":\"body\",\"sound\":\"default\",\"badge\":\"2\"} }"
}
Register device to sns and publish push notification
1 | import boto3 |