apple-push-notifications

Push notification in PHP

孤人 提交于 2019-11-29 14:42:34
问题 I get this error after trying to execute my php script to send a push notifcation to my iphone. I have tried everything and nothing works. I believe that this means my ck.pem is wrong but im not sure if its the key.pem or the cert.pem that is wrong. Please help Script // This this a fake device id: $deviceToken = '9870h8v088bj29u080af894jj67klfgcv9mmm79k8e4l23456h908743n093e359'; // fake password: $passphrase = '123456'; // Put your alert message here: $message = 'New Message'; //////////////

Observe CKRecord deletion via CKSubscription does not work

孤街浪徒 提交于 2019-11-29 14:07:02
问题 CKSubscription doc says: When a record modification causes a subscription to fire, the server sends push notifications to all devices with that subscription except for the one that made the original change to the record. Let assume I have two devices: device 1 and device 2 logged in from different iCloud accounts. Let assume both devices subscribed for record deletion for a certain record type. If device 1 creates a record and then device 1 deletes it then device 2 get notified - THAT IS

Open a ViewController from remote notification

混江龙づ霸主 提交于 2019-11-29 14:01:18
问题 I try to open a particular ViewController when my app catch a remote notification. Let me show my project's architecture. Here my storyboard : When I receive a notification I want open a "SimplePostViewController", so this is my appDelegate : var window: UIWindow? var navigationVC: UINavigationController? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { let notificationTypes: UIUserNotificationType =

ios Google Cloud Messaging (GCM) not receiving remote notifications

放肆的年华 提交于 2019-11-29 13:10:08
Problem: iOS isn't receiving any remote notifications from GCM, but can't find any information relating to why this would be the case. First time implementing push notifications, not sure what the cause of problem is. Situation: I am currently working on the iOS version of an app that uses GCM for push notifications. Notifications are being received fine on Android, however, it doesn't appear to be receiving at all on iOS. When I run the application, the console shows me that everything is fine, has a token, connected to GCM and subscribed to topics app[579:45511] Registration Token:

Badge Count is not increasing for push notification.always badge count remains 1?

橙三吉。 提交于 2019-11-29 13:05:26
My app badge count in not increasing when app is in background for push notifications.Count increase by 1 only for the first push notification and always remains badge count as 1, if i get more then 1 notification also badge count remaing 1 only. Below is my code - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { NSString *message = nil; id alert = [userInfo objectForKey:@"aps"]; if ([alert isKindOfClass:[NSString class]]) { message = alert; } else if ([alert isKindOfClass:[NSDictionary class]]) { message = [alert objectForKey:@"alert"]; }

New Command 2 Apple Push Notification Not sending multiple alerts

ぃ、小莉子 提交于 2019-11-29 12:39:15
I am trying to implement the new 'Command 2' push notification in Java and cannot have it push multiple alerts. First alert is pushed successfully. Please help if you can spot any issue on this code Apple specs https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW1 for (DeviceApps deviceApps : deviceAppsList) { outputStream.write(getByteArray(deviceApps, pushAlert)); } private byte[] getByteArray(DeviceApps deviceApps, PushAlert pushAlert) { ByteArrayOutputStream

Apple push notification not changing icon badge automatically

半城伤御伤魂 提交于 2019-11-29 12:15:23
问题 I have seen the mail app in my iPhone (4S, iOS 5.1) automatically updates the badge count if new mail arrives, even when app is not running. So it is possible to achieve this behavior in my app also, right? My application successfully registers for push notifications for all 3 types - Badge, Alert and Sound. Phone Settings is set ON for all 3 types of remote notifications for this application. My app receives remote notifications and shows alert, plays sound, but it does not update the badge

Background task when apns received

安稳与你 提交于 2019-11-29 12:14:06
After reading APNS documentation, I have implemented apns into my app. Everything works fine, but I have a question. I don't know if it is possible, but I would like to do a task when my app is in background and I receive a apns notification. This is my dictionary inside the notification: aps = { alert = "message"; sound = "default"; }; If my app is in foreground, I execute this code: - (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo { [HTTPConnection sendGetToUrl:[NSURL URLWithString:stringUrl]]; NSLog(@"Received notification: %@", userInfo);

How to detect “clear” notifications

雨燕双飞 提交于 2019-11-29 11:54:58
if more than a minute pass from the time a user notification arrived to notification center, there is a "clear" option to dismiss one or more notifications at once from notification center. How the iOS OS notify that the user tapped on "clear" to dismiss several notifications together? its possible from iOS 10 and above with implementation of custom notification, you will need to work with UNNotificaitons private func registerForRemoteNotificaiton(_ application: UIApplication) { // show the dialog at a more appropriate time move this registration accordingly. // [START register_for

iOS Push Notifications not working for Distribution

橙三吉。 提交于 2019-11-29 10:53:14
I have tried the Push Notification for my application for development and it's working fine. When I am generating the .p12 file of production(distribution) it's getting created. After deployin .pem file on the server it's throwing and error. OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv3 read server s ession ticket A: sslv3 alert certificate unknown):" } Server : RoR(Ruby on Rails) Any help would be very appreciable. Note : For the development .p12 it's working fine. The issue is when I'm deploying distribution .p12. Please suggest what may I be missing. Thanks and Regards