apple-push-notifications

APN php code giving Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.sandbox.push.apple.com:2195

谁都会走 提交于 2019-11-27 23:22:48
I am trying to implement Apple Push Notification using php code. Here's my code $deviceToken = 'My device token'; $passphrase = ''; $message = 'My first push notification!'; //////////////////////////////////////////////////////////////////////////////// $ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', 'apns-dev-cert.pem'); stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase); $fp = stream_socket_client( 'ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 120, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx); if (!$fp) exit("Failed

Open app at specified page with Push Notification

♀尐吖头ヾ 提交于 2019-11-27 22:45:15
问题 I am looking for a way to open an app on the page a pushnotification is pointing to. Is there a way to see if I have received any push notification when starting my app? Thanks in advance 回答1: Check for the launch option keys UIApplicationLaunchOptionsRemoteNotificationKey and UIApplicationLaunchOptionsLocalNotificationKey in the launchOptions-Dictionary given in application:didFinishLaunchingWithOptions: . 来源: https://stackoverflow.com/questions/4615412/open-app-at-specified-page-with-push

How to send actionable notifications to iOS with FireBase?

半世苍凉 提交于 2019-11-27 22:13:07
问题 We are currently evaluating Firebase as a future push notification service. Is there a way to send actionable notifications to iOS devices? At the moment we use parse to send pushes, we set the "category" parameter in the payload and the additional actions on the notifications are working. We tried to set this parameter in the firebase console or via the firebase rest api, but the notification actions are not working, it seems the payload is somehow different then iOS expects. 回答1: Thanks

how can I handle push notification when my app is not running

半腔热情 提交于 2019-11-27 21:55:59
问题 how can I handle push notification when my app is not running i am developing for ios3 .please help 回答1: A short example: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSDictionary *tmpDic = [launchOptions objectForKey:@"UIApplicationLaunchOptionsRemoteNotificationKey"]; //if tmpDic is not nil, then your app is launched due to an APNs push, therefore check this NSDictionary for further information if (tmpDic != nil) { NSLog(@" -

Apple Push Notification in Background Issue

限于喜欢 提交于 2019-11-27 21:36:39
I'm using parse.com as my APNs provider for a test app I'm building. I've confirmed that push notifications are working as I have been able to successfully receive alerts when the app is in the foreground. Also, I have the remote-notification value for the UIBackgroundModes key specified in my plist. In my app, I'm wanting to send a user's current location data back to my app-specific parse.com database when a push notification is received. I don't actually care about the notification payload itself, as the notification is just a means to getting a small piece of info. The app is constantly

How to update code using enabledRemoteNotificationTypes because it is “not supported in iOS 8”?

五迷三道 提交于 2019-11-27 21:21:45
问题 this is the code i used for the RemoteNotificationType: NSUInteger rntypes = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; The error i got was this: 2014-09-29 15:46:47.416 Dummy[258:21766] enabledRemoteNotificationTypes is not supported in iOS 8.0 and later. Would be a great help if someone could give me the solution. 回答1: You can also use this code: if ([[UIApplication sharedApplication] respondsToSelector:@selector(currentUserNotificationSettings)]) {

IOS - How to disable push notification at logout?

点点圈 提交于 2019-11-27 21:21:22
问题 My app registers the account at login in my server to enable push notification for a chat. Yet I haven't implemented yet the unregistration of the account at logout, so in this moment if I do the login with 2 accounts in the same device it can take the notification of both the accounts. At the same time, my notification center has a POST service which unregisters the 'login_name+ device token' from receive notification center. Where should I call it? Do I have to use

FCM rich push notification payload for iOS

a 夏天 提交于 2019-11-27 21:19:25
问题 I am using FCM for my project. It's have rich push notification for a type. I tried to modified most of possible ways to get push from FCM . I got obly ordinary push from FCM , not with image. I am also check with APNS same coding using push try. I got what expected design for push notification. Here my APNS payload { "aps": { "alert": "Enter your message", "badge": 1, "sound": "default", "content-available": 1, "mutable-content": 1 }, "mediaUrl": "https://upload.wikimedia.org/wikipedia

How do I send a HTTP/2 POST request in PHP

烂漫一生 提交于 2019-11-27 21:16:59
I found a similar question at Sending HTTP/2 POST request in Ruby But I want to update my server with PHP The new Apple push notification HTTP/2 based API described here: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html Anyone with HTTP/2 experience help me with making a request as a client in PHP. The CURL extension for PHP >= 5.5.24 has support for HTTP/2. (since this commit ) You also need a libcurl installed — the underlying library that the curl functions use — with HTTP/2 support enabled. That means a

How long does a push notification sit in queue before being removed?

送分小仙女□ 提交于 2019-11-27 21:16:53
I've been digging around trying to uncover some data for apple's push notifications for a client and something I have been unable to find an answer to is how long a push notification will sit in queue for an offline device before it will be removed. There maybe long periods of time, 2-3 months for example, in which the device maybe inactive and powered off. I'm simply interested in knowing how long I can expect a notification to linger, waiting to be delivered to an offline device, before it gets automatically removed (which is what I understand to be what happens). paislee Official developer