apple-push-notifications

Why can't I collapse my push notifications when I use Firebase FCM?

孤者浪人 提交于 2019-12-01 15:55:09
const options = { priority: 'high', collapseKey: user_id }; const deviceTokensPromise = db.ref('/users-fcm-tokens/' + user_id).once('value'); deviceTokensPromise.then(tokensSnapshot => { if (!tokensSnapshot.hasChildren()) { return console.log('There are no device tokens to send to.'); } const tokens = Object.keys(tokensSnapshot.val()); console.log(tokens); console.log(payload); return admin.messaging().sendToDevice(tokens, payload, options).then(response => { console.log(response); return removeInvalidFCMTokens(tokensSnapshot, response); }); }); I have a collapse-Key field in my options. When

Is it possible to prevent a remote notification from being displayed?

ぐ巨炮叔叔 提交于 2019-12-01 15:18:13
问题 I'd like to better control what notifications are being displayed to my users and selectively silence some of them. In order to do this I have implemented a UNNotificationServiceExtensionin my app, which allows me to intercept and modify notifications even when my app is not running. The problem however is that even if I don't call didReceive(_:withContentHandler:) the system will still display the remote notification after approximately 30 seconds. How can I prevent this from happening? 回答1:

Why can't I collapse my push notifications when I use Firebase FCM?

自古美人都是妖i 提交于 2019-12-01 14:59:17
问题 const options = { priority: 'high', collapseKey: user_id }; const deviceTokensPromise = db.ref('/users-fcm-tokens/' + user_id).once('value'); deviceTokensPromise.then(tokensSnapshot => { if (!tokensSnapshot.hasChildren()) { return console.log('There are no device tokens to send to.'); } const tokens = Object.keys(tokensSnapshot.val()); console.log(tokens); console.log(payload); return admin.messaging().sendToDevice(tokens, payload, options).then(response => { console.log(response); return

APNS - notifications push ios: Connection reset by peer PHP

左心房为你撑大大i 提交于 2019-12-01 13:38:07
I have had Push Notifications working fine. But some of the times, from nowhere it starts giving error: stream_socket_client(): SSL: Connection reset by peer Weird thing is i don't have to do anything to resolve it but wait. After sometime, it starts working back again. I know it is a duplicate of many questions like: notifications-push-ios-connection-reset-by-peer But none of them solves my problem. I am using PHP stream_socket_client to generate the socket connection Code in use is: <?php ini_set('display_errors','On'); error_reporting(E_ALL); $deviceToken=

How to remove push notification API

。_饼干妹妹 提交于 2019-12-01 13:14:09
Apple sends the following email when submitting iOS app: Missing Push Notification Entitlement - Your app appears to include API used to register with the Apple Push Notification service, but the app signature's entitlements do not include the "aps-environment" entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the "aps-environment" entitlement. See "Provisioning and Development" in the Local and Push

Launch app in background automatically?

六眼飞鱼酱① 提交于 2019-12-01 12:51:51
问题 Is there a way to persist an iOS app in the background such that it starts up automatically when the device is turned on and will re-launch later if terminated? I have read a few posts on either voip and gps services. My app sends emergency SMS messages with the user's location. It needs to remain active to listen for distress triggers. Would it be possibly to start up the app automatically with sending push notifications to the app using an APNS server? 回答1: Yes, you can start your app using

How to read push notifications from other apps in iOS

夙愿已清 提交于 2019-12-01 12:11:43
I wanted to know how to be able to read and get the contents of another app's push notification in iOS. Such as a push notification from Facebook Messenger, or Twitter. I know this is possible because that is exactly what the Pebble Smartwatch iOS app does. It intercepts the push notifications of the iPhone and sends them to the smartwatch over Bluetooth. Devices such as the Pebble, use the ANCS service with Bluetooth. An app cannot directly access the notifications for/from other apps. 来源: https://stackoverflow.com/questions/27352743/how-to-read-push-notifications-from-other-apps-in-ios

Which method will be triggered when the notification received on iPhone(not after the notification is tapped and opened)?

﹥>﹥吖頭↗ 提交于 2019-12-01 12:11:11
I’m now using didReceiveRemoteNotification to get the payload of the notification pushed from Parse, however, it is only triggered when the notification is tapped and opened. What I’m trying to do is start an alarm to remind the user that a notification has arrived, so I guess didReceiveRemoteNotification is not what I’m looking for. Which method should I look into for this purpose? Thank you! Words from The WWDC 2014 Whats New in iOS Notifications Local and push notifications let background or inactive apps notify users that an event of interest has occurred, or that an app has new

How to read push notifications from other apps in iOS

删除回忆录丶 提交于 2019-12-01 11:49:15
问题 I wanted to know how to be able to read and get the contents of another app's push notification in iOS. Such as a push notification from Facebook Messenger, or Twitter. I know this is possible because that is exactly what the Pebble Smartwatch iOS app does. It intercepts the push notifications of the iPhone and sends them to the smartwatch over Bluetooth. 回答1: Devices such as the Pebble, use the ANCS service with Bluetooth. An app cannot directly access the notifications for/from other apps.

How to clear badge number while preserving notification center

泄露秘密 提交于 2019-12-01 10:52:40
问题 I use [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0] to clear badge number. It works fine but remote notifications are removed at the same time. There are many other questions to clear notification center but I would NOT like to clear them. I just want to clear number of badge while preserving notifications. Is there any way to achieve this? 回答1: One hacky way around this is to set the badge count to a negative value. Negative values aren't shown on the home screen and