apple-push-notifications

Where can I store the iOS device token for later use?

限于喜欢 提交于 2020-01-03 02:59:10
问题 Right now I'm getting the device token via didRegisterForRemoteNotificationsWithDeviceToken . However, I need to use the device token later on in my application after my user logs in. How can I access the deviceToken from elsewhere in application later on, and if I cannot, how/where can I store it in didRegisterForRemoteNotificationsWithDeviceToken so I can retrieve it later on? 回答1: The most simple way is to use NSUserDefaults Saving: NSUserDefaults * ud = [NSUserDefaults

apple push notification with php script

旧街凉风 提交于 2020-01-03 02:58:13
问题 I am able to connected to the apns and by inserting the values to database for just check i am getting "message delivered" message but it's not showing any notification....can anybody tell me where i am mistaken... $deviceToken = '**********************'; $payload['aps'] = array('alert' => 'This is the alert text', 'badge' => 1, 'sound' => 'default'); $payload = json_encode($payload); $passphrase = '***'; $apnsHost = 'gateway.sandbox.push.apple.com'; $apnsPort = 2195; $apnsCert = 'ck.pem';

EasyAPNS: Has anybody tried it with large amounts of notifications?

落花浮王杯 提交于 2020-01-03 02:54:08
问题 I implemented EasyAPNS in my app and server and currently have a database with 2000+ registered devices. Today I tried to send notifications to all of these devices and the script timed out. I checked the code (should've done it earlier, I know) and I discovered it opens a connection for each message . Basically this thing will never work and will get my IP banned, right? How's it even possible that this problem is not mentioned anywhere in the Google group? Apparently nobody tried this

Use of silent APNS push notifications to send token without user notification?

心不动则不痛 提交于 2020-01-02 09:12:06
问题 I've checked through other questions and responses here at StackOverflow but couldn't see something exactly like this; I would like to be able to push a token via APNS. The purpose of this is to verify that a subsequent user request to a restful web service comes from an iPhone device and not from a non-iPhone source (it's trivial to change HTTP headers to fake looking like an iPhone request). Couple of questions: Is it permissible under Apple Guidelines to insist that push notifications be

Reset urbanairship badge count

五迷三道 提交于 2020-01-02 07:45:09
问题 Problem: Let say I get 3 notification. It shows the badge count 3 on my app icon. I open the app or click on the notification and it clears the badge (All Good so far) Now when I get a new notification, the badge count shown on my app icon is 4 instead of 1 That means that the badge count was not reset on Urbanairship end My Code so far: -(void)resetBadgeNotifications:(UIApplication *)application using:(NSDictionary *)notificationInfo{ if( notificationInfo != nil ){ [[NSNotificationCenter

apn_sender and Rails 3

血红的双手。 提交于 2020-01-02 05:22:27
问题 I have a project that needs to send notifications from server to device. I don't know how and where to start (create table first or other), because I'm new to Ruby on Rails. I've follow the apn_sender tutorial but it won't work and always errors out on start. Is there any full tutorial to create apn_sender for Rails 3? Thanks 回答1: Rails 3 and apn_sender I too have been working on the apn_sender problem, because I like that the Apple Push Notification support seems pretty robust. However, the

Linking user account to device token for push notifications

折月煮酒 提交于 2020-01-02 04:40:08
问题 I have an app set up with an API server and each user creates an account either by email or facebook when they download the app. That information is all stored in the back end. I want to enable push notifications so that they are user specific. I know what needs to be done on the back end with APNS server etc. My question is linking the Device Token with a user account so I can send the right user the right information based on logic from my servers. I know that I place this code in the

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

How can I add media attachments to my push notifications in an iOS 10 app?

允我心安 提交于 2020-01-02 01:37:27
问题 There are multiple examples how you should set up your project to add rich notifications which use 'media attachments' technology to show images. I've read most of them but something I missed, because my project does not display any rich notifications with this payload (tested with APNS-Tool and Boodle): { "aps":{ "alert":{ "title": "Rich test", "body": "Dancing Banana" }, "mutable-content": 1 } } The notification is visible, but on 3D Touch, there are no additional infos displayed (like the

Is there a way to deliver push notifications in iOS 11 during Guided Access?

吃可爱长大的小学妹 提交于 2020-01-02 01:11:13
问题 Our iPad app relies on silent push notifications to trigger certain events, and is used by many of our users in Guided Access mode. This has worked well until iOS 11 which now seems to block delivery of push notifications while Guided Access is enabled. I've tried a variety of different payloads according to the Apple documentation here (such as content-available, alert, sound, badge etc.), but I can't get anything to be delivered while Guided Access is enabled. This isn't necessarily a bug,