push-notification
How does push notification technology work on Android?
From what I’ve heard during an Android developers conference in Israel: There is simply a TCP socket waiting in accept mode on a cloud Google server. The TCP connection had been initiated by the Google Play application. That’s why Google Play must be installed on the device for making Google Cloud Messaging (GCM) (formerly Android … Read more
Sending multiple iPhone push notifications + APNS + PHP
Simple way to do it without use any file. You can call it multiple times with different tokeid. $ctx = stream_context_create(); stream_context_set_option($ctx, ‘ssl’, ‘local_cert’, ‘ckipad.pem’); stream_context_set_option($ctx, ‘ssl’, ‘passphrase’, $passphrase); $fp = stream_socket_client(‘ssl://gateway.sandbox.push.apple.com:2195’, $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx); //if (!$fp) //exit(“Failed to connect amarnew: $err $errstr” . PHP_EOL); //echo ‘Connected to APNS’ . PHP_EOL; // Create … Read more
Get device token for push notification
NOTE: The below solution no longer works on iOS 13+ devices – it will return garbage data. Please use following code instead: + (NSString *)hexadecimalStringFromData:(NSData *)data { NSUInteger dataLength = data.length; if (dataLength == 0) { return nil; } const unsigned char *dataBuffer = (const unsigned char *)data.bytes; NSMutableString *hexString = [NSMutableString stringWithCapacity:(dataLength * 2)]; … Read more
Silent Push Notification in iOS 7 does not work
This works also and does not play a sound when it arrives: { aps = { “content-available” : 1, sound : “” }; } EDIT People having this problem may want to check out this link. I have been participating in a thread on Apple’s Developer forum that goes over all app states and when … Read more
Debugging App When Launched by Push Notification
In Xcode < 4.0 (for Xcode >= 4, see answer by delirus below), you can now configure Xcode to attach the debugger to the app after you launch it, instead of launching the app through the debugger. This lets you debug things that vary based on the launch state of your application, such as URL … Read more