firebase-cloud-messaging

How to convert a FCM token to APNS token?

こ雲淡風輕ζ 提交于 2020-01-02 02:41:45
问题 We consider migrating from Firebase Cloud Messaging to build our own push engine. We need to migrate the users converting FCM tokens to get the raw APNS token. How can that be done? I can only find a procedure to convert APNS to FCM tokens. https://developers.google.com/instance-id/reference/server#create_registration_tokens_for_apns_tokens Any way to decode the FCM tokens? 回答1: You can get the token from react-native-firebase with the following way. firebase .messaging() .ios

Firebase Notifications using node.js

女生的网名这么多〃 提交于 2020-01-01 19:58:34
问题 I'm working with Firebase notifications using node.js. After compile, when I'm sending request to other user of app (request makes notification), firebase log shows error: TypeError: Cannot read property 'receiver_id' of undefined at exports.sendNotification.functions.database.ref.onWrite.event (/user_code/index.js:12:36) at Object. (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:112:27) at next (native) at /user_code/node_modules/firebase-functions/lib/cloud-functions.js

Firebase Notification not working in background

你。 提交于 2020-01-01 15:47:27
问题 I need help. Firebase Notifications is Not Working in Background. This is My Code: @Override public void onMessageReceived(RemoteMessage remoteMessage) { Log.d(TAG, "FROM:" + remoteMessage.getFrom()); sharedPreference = getSharedPreferences(Global.SECURETRADE, 0); UID = sharedPreference.getString(Global.ID, ""); Uri defaultSoundUri=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)`enter code here`; NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder

Firebase Notification not working in background

北城以北 提交于 2020-01-01 15:47:12
问题 I need help. Firebase Notifications is Not Working in Background. This is My Code: @Override public void onMessageReceived(RemoteMessage remoteMessage) { Log.d(TAG, "FROM:" + remoteMessage.getFrom()); sharedPreference = getSharedPreferences(Global.SECURETRADE, 0); UID = sharedPreference.getString(Global.ID, ""); Uri defaultSoundUri=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)`enter code here`; NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder

FCM custom notification for ios

六月ゝ 毕业季﹏ 提交于 2020-01-01 12:30:30
问题 I know this question have been ask a lot of time in android but not ios. So I already test out push notification with FCM it work fine. Mine problem is wether it's a way to create custom notification rather than letting the system to handle the notification with the notification payload? 回答1: -Users can send data messages with FCM.What you have to send is, Sample PostMan Json data: { "data": { "any key": "any value", "any key 2": "any value 2" }, "to" : "token received to mobile from FCM" }

how get message body when FCM notification message is tap?

旧城冷巷雨未停 提交于 2020-01-01 10:28:17
问题 When app is in background, the notification message is deliver by Notification, when the notification is tap, app is launch, how can i get the message body? the intent is this: Bundle[{google.sent_time=1470813025421, from=568540028909, google.message_id=0:1470813025865549%31bd1c9631bd1c96, collapse_key=com.google.firebase.quickstart.fcm}] no message body in intent, only message id! Thanks! 回答1: try this @Override public void onMessageReceived(RemoteMessage remoteMessage) { // TODO(developer):

FCM - How to fix android.app.RemoteServiceException: Bad notification posted from package Couldn't expand RemoteViews for: StatusBarNotification

南笙酒味 提交于 2020-01-01 09:17:20
问题 I am seeing 1000s of crash reports related to notification with no viable way to debug or check app code for notifications in Firebase Cloud Messaging Fatal Exception: android.app.RemoteServiceException: Bad notification posted from package com.appbootup.ipo.news: Couldn't expand RemoteViews for: StatusBarNotification(pkg=com.appbootup.ipo.news user=UserHandle{0} id=2 tag=IPO-SME score=10: Notification(pri=1 contentView=com.appbootup.ipo.news/0x1090064 vibrate=null sound=null defaults=0x0

How to send upstream messages with FCM from android client?

荒凉一梦 提交于 2020-01-01 03:34:09
问题 We were using GoogleCloudMessaging.getInstance(context).send(context.getString(R.string.gcm_defaultSenderId) + "@gcm.googleapis.com", mId, mBundle); to send upstream messages, but since I was trying to migrate new fcm concept, I need to change that too, but could not find any documentation yet. My best guess is to use : RemoteMessage message = new RemoteMessage.Builder(<?>).setMessageId(mId).setData ... FirebaseMessaging.getInstance().send(message); but then what is it the Builder takes as a

MyFirebaseInstanceIdService didn't invoked why?

 ̄綄美尐妖づ 提交于 2019-12-31 07:36:48
问题 I have initiated MyFirebaseInstanseIdService in order to get token , directly i will show you the code : @Override public void onTokenRefresh() { super.onTokenRefresh(); String refreshedToken = FirebaseInstanceId.getInstance().getToken(); storeRegIdInPref(refreshedToken); sendRegistrationToServer(refreshedToken); Intent registrationComplete = new Intent(Config.REGISTRATION_COMPLETE); registrationComplete.putExtra("token", refreshedToken); LocalBroadcastManager.getInstance(this).sendBroadcast

Firebase cloud function - returned undefined,expected Promise or value

此生再无相见时 提交于 2019-12-31 05:47:07
问题 I'm trying to send a notification to a user but for some reason i have an error. The error is "Function returned undefined, expected Promise or value". I cant understand what does this line means, hope you guys can take a look at my code and tell me where im wrong. CODE exports.sendNotification = functions.database.ref('/likes/{videoId}/{currentUser}').onWrite(event =>{ console.log("Start send like notification"); const model = event.data.val(); let ownerVideoUserId = model.userVideoID; let