apple-push-notifications

Identifying the Push Notification Message

↘锁芯ラ 提交于 2019-12-08 19:29:26
In my project I want to show the events and offers through push notification, but the problem is, I'm able to show the events or offers, not both. Is there any way to identify the message of Push notification. Here's the code: - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { NSString *message = nil; id alert = [userInfo objectForKey:@"alert"]; if ([alert isKindOfClass:[NSString class]]) { message = alert; } else if ([alert isKindOfClass:[NSDictionary class]]) { message = [alert objectForKey:@"body"]; } if (alert) { UIAlertView *alertView

Set timeout for UILocalNotification (remove it from lockscreen and notification center after some time)

两盒软妹~` 提交于 2019-12-08 18:14:47
问题 I would like to set a UILocalNotification that will disappear from the lock screen and the notification center after five minutes (if the user won't tap on it). Can I set a timeout for the notification? Or maybe fire another notification that will delete it? 回答1: Disclaimer: The code will work only if you wake the app. In my case this code is called from application(_:handleActionWithIdentifier:for:completionHandler:) , which is triggered from a local notification, which in its turn is called

Handle APNS Remote Notifications while in Background

时间秒杀一切 提交于 2019-12-08 18:11:08
问题 I have implemented all recommended methods in AppDelegate to get working Remote Notifications service. I can accept them while running, while launching and while turned off. But there is an issue, since I can't work with many received notifications while in background. I can work only with latest notification. What is recommended manual to do that? How can I got all notifications received while in background? Is it only solvable via manual call to my service provider (sender of apns data)?

Can server-to-client messaging rely on APNS?

自古美人都是妖i 提交于 2019-12-08 17:36:27
问题 I'm working on a messaging app and I have a dilemma about how to send data from server to client. I'm using a centralized server design, where clients uses NSURLConnection to send messages to the server, the server doesn't keep and manage open sockets and can't send a message for one of the clients. So clients use a timer and query the server every 2 seconds to see if new data is waiting for them. The problem with this approach is that polling the server every 2 second seem to kill the

Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195'

跟風遠走 提交于 2019-12-08 17:16:59
问题 I sucessfully run the APNS code in my macbook air, but it turns out that I can not run it in my other computer: I checked that these are the same: 1. .pem file ( to be specific ) 2. Program The computers can not work are: Windows 7,XAMPP,OpenSSL supported,No firewall And EC2 Linux server with 2195 and 2196 opened What might be other issues causing that I got this error in my php code? Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195' I know there might be cause by not opening

iOS - APNS With InHouse Distribution

二次信任 提交于 2019-12-08 17:00:41
A common problem that is being faced by many developers, I'm posting it again as I couldn't get any right solution. For distribution of apps using InHouse account (by OTA), how is it possible to send push notifications to the apps installed on devices. With development profile, everything works good during. The problem is when distribution only. How will Apple recognize that the bundle identifier is being used in house distributed application? How will Apple recognize that the bundle identifier is being used in house distributed application? Apple will recognize the app ID because you added

Send iOS Push notification in php with .p8 file

怎甘沉沦 提交于 2019-12-08 15:56:22
问题 Apple has updated their push notification service and the certificate file received is now a .p8 file. There are many examples online of how to send a push notification with the .pem file but I can't find anything for a .p8 file. Does anyone have any code that works with the .p8 file? 回答1: With the script below I'm able to send token-based push notifications with the .p8 file. The minimum version of curl supporting this is 7.38.0, and it must be compiled with the flag --with-nghttp2 and

Is it possible to send SILENT LOCAL notification on iOS

谁说胖子不能爱 提交于 2019-12-08 15:32:30
问题 My app wakes up from suspended mode on silent remote notification from a server, exactly as I want. This server sends a push notification with " content-available :1", which does the job. Now I want to do this without the help of a server and so I want to send silent local notifications (from the app) at a time in the future (like after 15 min.), but can't find a way to set "content-available:1". So I end up getting local notification that doesn't wake up my app, as I can with remote

Google push notification not working in production

女生的网名这么多〃 提交于 2019-12-08 13:59:54
问题 I am getting this error on IOS google push notification The operation couldn’t be completed. (com.google.gcm error 501.) I get the registration id in development environment and production environment. The message of development enviornment: {"multicast_id":8145067860904395870,"success":1,"failure":0,"canonical_ids":0,"results": [{"message_id":"0:1452842547360715%bc92eed1bc92eed1"}]} and I successfully receive the message. But in production environment I get this message. {"multicast_id"

APN Error in Server Script

柔情痞子 提交于 2019-12-08 13:46:38
问题 I am getting this error in my php script , while sending payload data. Warning: stream_socket_client() [function.stream-socket-client]: Unable to set private key file `/Applications/XAMPP/xamppfiles/htdocs/test/apn/apns-dev.pem' in /Applications/XAMPP/xamppfiles/htdocs/test/apn/push.php on line 42 Warning: stream_socket_client() [function.stream-socket-client]: failed to create an SSL handle in /Applications/XAMPP/xamppfiles/htdocs/test/apn/push.php on line 42 Warning: stream_socket_client()