Search Results

Search found 52 results on 3 pages for 'apns'.

Page 1/3 | 1 2 3  | Next Page >

  • Unable to connect to APNS with java-apns

    - by Mac
    I've got a Java program running on a firewalled server that is intended to send push notifications to my iPhone app by using java-apns. Problem is, whenever I try to send a notification the library fails to connect to the APNS server. From the stack trace, it seems that when creating the required SSL connection, the connection is being refused at some point (a java.net.ConnectException with a detail message of "connection refused" is being thrown when the library calls SSLSocketFactory's createSocket method). It would not surprise me at all if the firewall is blocking the connection, but unfortunately as I do not manage the server I am unable to verify that that is indeed the case. The fact that the program works fine from my (non-firewalled) desktop seems to support the theory. My question is, does anyone know of any method by which I can find the root cause of the problem, and/or can anyone tell me what I should tell the server admin to change to get things to work (if it is indeed the firewall that's the problem)? For reference, the server is a Linux box and I'm using version 0.1.2 of java-apns.

    Read the article

  • APNs notification failure...

    - by Kamal Challa
    Hi , i tried the following code (PHP) $apnsHost = 'gateway.sandbox.push.apple.com'; $apnsPort = 2195; $apnsCert = 'apple_push_notification_production.pem'; $streamContext = stream_context_create(); stream_context_set_option($streamContext, 'ssl', 'local_cert', $apnsCert); $apns = stream_socket_client('ssl://' . $apnsHost . ':' . $apnsPort, $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext); if($apns) { echo "Connection Established<br/>"; $deviceToken = '**********';//masked $body = array(); $body['aps'] = array(’alert’ => "test message"); //$body['aps']['badge'] = 1; $payload = json_encode($body); $apnsMessage = chr(0) . pack("n",32) . pack('H*', str_replace(' ', '', $deviceToken)) . pack("n",strlen($payload)) . $payload; print "sending message :" . $apnsMessage . "<br/>"; print "sending payload :" . $payload . "<br/>"; fwrite($apns, $apnsMessage); } else { echo "Connection Failed"; echo $errorString; echo $error; } socket_close($apns); fclose($apns); reply is Connection Established sending message :?? d^÷Îå0ZCd%1ÄuwOOYš'ÊÈ}ârðm¾Í?,{"aps":{"\u2019alert\u2019":"test message"}} sending payload :{"aps":{"\u2019alert\u2019":"test message"}} But am not able to get the notification any help?

    Read the article

  • Determine whether app is communicating with APNS sandbox or production environment

    - by goldierox
    I have push notifications set up in my app. I'm trying to determine whether the device token I've received from APNS in the application:didRegisterForRemoteNotificationsWithDeviceToken: method came from the sandbox or development environment. If I can distinguish which environment initialized the token, I'll be able to tell my server to which environment to send the push notification. I've tried using the DEBUG macro to determine this, but I've seen some strange behavior with this and don't trust it to be 100% correct. #ifdef DEBUG BOOL isProd = YES; #else BOOL isProd = NO; #endif Ideally, I'd be able to examine the aps-environment entitlement (value is Development or Production) in code, but I'm not sure if this is even possible. What's the proper way to determine whether your app is communicating with the APNS sandbox or production environments? I'm assuming that the server needs to know this in the first place. Please correct me if this is assumption is incorrect. Edited: Apple's documentation on Provider Communication with APNS details the difference between communicating with the sandbox and production. However, the documentation doesn't give information on how to be consistent with registering the token (from the iOS client app) and communicating with the server.

    Read the article

  • APNS: Not receving any feedback for registerForRemoteNotificationTypes: neither +/-

    - by vviji
    Hi, I have been trying to use the default code in the iPhone APNS documentation to generate a device token using registerForRemoteNotificationTypes() but without succes. Neither the didRegisterForRemoteNotificationsWithDeviceToken or the didFailToRegisterForRemoteNotificationsWithError is called. I had placed a UIAlert in both these methods- both did not appear. My iPhone is acceesing APNS using Wi/Fi using DHCP.(& am able to browse ) Is there any other setting that needs to to be done to genrate a device token? can someone post a working code which can be used to generate device token? Thanks, V

    Read the article

  • Distributing APNS providers

    - by Sam
    I'm writing a business-focused iPhone app which includes a self-hosted server component. I'd like to include push notification functionality in the server; reading through the programming guide it looks as if this would involve either: Distributing the provider certificate with the server component - this doesn't sound like a terribly good idea (even if Apple permits it?) Hosting a shared notification provider and forwarding notifications to APNS from the servers. For an ongoing, high-availability service, this is likely to require including a subscription pricing component, which I would prefer to avoid. Require customers to apply for their own provider certificate. However, it's not clear whether multiple organisations are allowed to apply for provider certificates with a single bundle ID, and it would significantly increase the barrier to adoption. APNS looks to me as if it's specifically geared for centrally hosted services. Is anyone distributing self-hosted notification providers? Are there any other options?

    Read the article

  • HOWTO remove device tokens received by Apple APNS feedback

    - by Mladen
    Hi Guys, I am successfully fetching Apple APNS feedback data via PHP. The structure that I am getting (after some processing) looks something like this: timestamp device token My question is how to know which of the device tokens should I remove from my database and stop sending notifications to them. Regardz, Mladjo

    Read the article

  • Push notifications....Feedback problem, when using apns-sharp C# library

    - by Artur
    Hello everybody. I've installed on my iPhone ad-hoc version, so it means distribution one. I've downloaded apns-shart library and tried to test push notifications on that. I have all necessary certificates. I've succeeded to push notifications using test notification project and with this everything is fine. My problem is: when I've tried to use test feedback project it fetched needed device tokens, but when I've tried to launch it second time, it return 0 bytes. What ca I do to fix the problem.

    Read the article

  • APNS Sending Frequent Notifications to Device

    - by user564447
    I'm trying to mimic a pager with my app by sending push notifications to the user until he or she responds. My thought was to send a push every few seconds and play the default sound on arrival. Not perfect, but better than nothing. It's working all right. However, I am finding that the sound starts to stutter/interrupt a bit after a few notifications have been sent -- as if it's trying to play the sound more than once. This happens even if I only send the push every 10 seconds. I just tested it at 20 second intervals and even then it starts to sound interrupted after about 10 times. Any idea how to resolve this so each message plays the sound crisply? p.s. Testing performed on an iPad.

    Read the article

  • How to use Apple Push Notifications to update a Passbook

    - by keithcelt
    I have created Passbooks and they are loaded onto my customer's iOS devices. I need to update these Passbooks. According to the Passbook docs you need to use the Apple Push Notification Service (APNS) to trigger a pull from the iOS device in order to update the Passbook. This APNS push consists of a "push token" and a "pass type id." However, the APNS body is to be left empty. The APNS docs talk about a "device token" needed to send a push notification but make no mention of a "push token." Is an APNS "device token" the same as a Passbook "push token"? How do I send the Passbook "pass type id" in my APNS push?

    Read the article

  • Keeping connection to APNs open on App Engine using Modules in Go

    - by user3727820
    I'm trying to implement iOS push notifications for a messageboard app I've written (so like notification for new message ect. ect.) but have no real idea where to start. Alot the current documentation seems to be out of date in regard to keeping persistent TLS connections open to the APNs from App Engine and links to articles about depreciated backends I'm using the Go runtime and just keep getting stuck. For instance, the creation of the socket connection to APNs requires a Context which can only be got from a HTTP request, but architecturally this doesn't seem to make a lot of sense because ideally the socket remains open regardless. Is there any clearer guides around that I'm missing or right now is it a better idea to setup a separate VPS or compute instance to handle it?

    Read the article

  • Provisioning problem with certificate and APNs

    - by Florent
    Hi all ! I hava a big problem, here is the deal : I've made an app which has an id, on an another machine i've submit the app to the app store, now i have another mac, and i have made the AppIds using my old mac (so i used an old cer to make the push certificates), next made my apns cert for my server and i have : unable to connect to ssl://gateway.... I do not know what to do because i cannot create another appId using the same id and can't remove an app Id. Thanks to all

    Read the article

  • Apple push notifications and Emoji characters...

    - by Friendlydeveloper
    Hello, I recently found this very interesting article on APNS and Emoji characters: EASY APNS - Just for fun It contains a list with all supported Emojis. However, I couldn't get them to display in my push notifications. All I get is the code, not the image. For example, if I add \ue415 (a smiley) to my message, I never see the image, just the code. Any idea what I'm doing wrong? Thanks in advance.

    Read the article

  • Apple Push Notification Service server load?

    - by jenningj
    I'm preparing to set up a APNS message server, and I was wondering if anybody has done any analysis on APNS server load that they would be able to share. Minimum server specs, maximum messages per second, anything like that. Thanks! edit: I'm planning to implement this with .NET, but info about any platform would be incredibly useful.

    Read the article

  • Push notification is successfully sent, but the device does not receive (occasionally)

    - by ashiina
    I have been having a problem where some devices will not receive a push notification, since yesterday. The certificate / devicetoken seem to be correct, since the device used to successfully receive push notifications until yesterday. On the server-side, there are no errors or connection refusals, and the push notification seems to be successfully sent every time. But still, there are many occasions where the device does not correctly receive the push. Some surrounding information: I am doing this on the production environment. No errors / connection refusals on the server-side I am sending the exactly same JSON everytime. 2 of our devices are not receiving the push notification AT ALL since yesterday 1 of our device receives push notifications at a lower success rate (about 70%) than yesterday 1~2 of our devices still receive push notifications successfully even now. All of the above devices were able to receive push notifications properly on the production environment until yesterday. There is no difference in the server-side result for when the push is successful, and when the device doesn't receive it... Therefore it is virtually impossible to identify the problem. This is the server-side PHP code I am using: $ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', $this->apnsData[$development]['certificate']); $fp = stream_socket_client($this->apnsData[$development]['ssl'], $error, $errorString, 100, (STREAM_CLIENT_C ONNECT|STREAM_CLIENT_PERSISTENT), $ctx); if(!$fp){ $this->_pushFailed($pid); $this->_triggerError("Failed to connect to APNS: {$error} {$errorString}."); } else { $msg = chr(0).pack("n",32).pack('H*',$token).pack("n",strlen($message)).$message; $fwrite = fwrite($fp, $msg); if(!$fwrite) { error_log("[APNS] push failed..."); $this->_pushFailed($pid); $this->_triggerError("Failed writing to stream.", E_USER_ERROR); } else { error_log("[APNS] push successful! ::: $token -> $message ($fwrite bytes)"); } } fclose($fp); The log tells me that the push was successful (Cutting out the token for privacy) : [Wed Dec 12 11:42:00 2012] [error] [client 10.161.6.177] [APNS] push successful! ::: aa4f******44 -> {"aps":{"alert":{"body":"\\u300casdfasdf\\u300d","action-loc-key":"OK"},"badge":4,"sound":"chime"}} (134 bytes) Is there any way I can get help on this problem? Or is there anybody who is having the same problem?? Please help! I am getting complaints from some users on this....

    Read the article

  • iOS Support with Windows Azure Mobile Services – now with Push Notifications

    - by ScottGu
    A few weeks ago I posted about a number of improvements to Windows Azure Mobile Services. One of these was the addition of an Objective-C client SDK that allows iOS developers to easily use Mobile Services for data and authentication.  Today I'm excited to announce a number of improvement to our iOS SDK and, most significantly, our new support for Push Notifications via APNS (Apple Push Notification Services).  This makes it incredibly easy to fire push notifications to your iOS users from Windows Azure Mobile Service scripts. Push Notifications via APNS We've provided two complete tutorials that take you step-by-step through the provisioning and setup process to enable your Windows Azure Mobile Service application with APNS (Apple Push Notification Services), including all of the steps required to configure your application for push in the Apple iOS provisioning portal: Getting started with Push Notifications - iOS Push notifications to users by using Mobile Services - iOS Once you've configured your application in the Apple iOS provisioning portal and uploaded the APNS push certificate to the Apple provisioning portal, it's just a matter of uploading your APNS push certificate to Mobile Services using the Windows Azure admin portal: Clicking the “upload” within the “Push” tab of your Mobile Service allows you to browse your local file-system and locate/upload your exported certificate.  As part of this you can also select whether you want to use the sandbox (dev) or production (prod) Apple service: Now, the code to send a push notification to your clients from within a Windows Azure Mobile Service is as easy as the code below: push.apns.send(deviceToken, {      alert: 'Toast: A new Mobile Services task.',      sound: 'default' }); This will cause Windows Azure Mobile Services to connect to APNS (Apple Push Notification Service) and send a notification to the iOS device you specified via the deviceToken: Check out our reference documentation for full details on how to use the new Windows Azure Mobile Services apns object to send your push notifications. Feedback Scripts An important part of working with any PNS (Push Notification Service) is handling feedback for expired device tokens and channels. This typically happens when your application is uninstalled from a particular device and can no longer receive your notifications. With Windows Notification Services you get an instant response from the HTTP server.  Apple’s Notification Services works in a slightly different way and provides an additional endpoint you can connect to poll for a list of expired tokens. As with all of the capabilities we integrate with Mobile Services, our goal is to allow developers to focus more on building their app and less on building infrastructure to support their ideas. Therefore we knew we had to provide a simple way for developers to integrate feedback from APNS on a regular basis.  This week’s update now includes a new screen in the portal that allows you to optionally provide a script to process your APNS feedback – and it will be executed by Mobile Services on an ongoing basis: This script is invoked periodically while your service is active. To poll the feedback endpoint you can simply call the apns object's getFeedback method from within this script: push.apns.getFeedback({       success: function(results) {           // results is an array of objects with a deviceToken and time properties      } }); This returns you a list of invalid tokens that can now be removed from your database. iOS Client SDK improvements Over the last month we've continued to work with a number of iOS advisors to make improvements to our Objective-C SDK. The SDK is being developed under an open source license (Apache 2.0) and is available on github. Many of the improvements are behind the scenes to improve performance and memory usage. However, one of the biggest improvements to our iOS Client API is the addition of an even easier login method.  Below is the Objective-C code you can now write to invoke it: [client loginWithProvider:@"twitter"                     onController:self                        animated:YES                      completion:^(MSUser *user, NSError *error) {      // if no error, you are now logged in via twitter }]; This code will automatically present and dismiss our login view controller as a modal dialog on the specified controller.  This does all the hard work for you and makes login via Twitter, Google, Facebook and Microsoft Account identities just a single line of code. My colleague Josh just posted a short video demonstrating these new features which I'd recommend checking out: Summary The above features are all now live in production and are available to use immediately.  If you don’t already have a Windows Azure account, you can sign-up for a free trial and start using Mobile Services today. Visit the Windows Azure Mobile Developer Center to learn more about how to build apps with Mobile Services. Hope this helps, Scott P.S. In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu

    Read the article

  • iPhone Feedback Service with PHP

    - by Anish
    HI All, Has anybody been able to extract the device tokens from the binary data that iPhone APNS feedback service returns using PHP? I am looking for something similar to what is been implementented using python here http://www.google.com/codesearch/p?hl=en&sa=N&cd=2&ct=rc#m5eOMDWiKUs/APNSWrapper/%5F%5Finit%5F%5F.py&q=feedback.push.apple.com As per the Apple documentation, I know that the first 4 bytes are timestamp, next 2 bytes is the length of the token and rest of the bytes are the actual token in binary format. (http://developer.apple.com/IPhone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html#//apple%5Fref/doc/uid/TP40008194-CH101-SW3) I am successfully able to extract the timestamp from the data feedback service returns, but the device token that I get after i convert to hexadecimal using the PHP's built in method bin2hex() is actually different than original device token. I am doing something silly in the conversion. Can anybody help me out if they have already implemented APNS feedback service using PHP? TIA, -Anish

    Read the article

  • Push notification not received in ios5 device

    - by Surender Rathore
    I am sending push notification on device which has iOS 5.0.1, but notification is not received on iOS5 device. If i try to send notification on iOS4.3.3 device, it received on this device. My server is developed in c# and apple push notification certificate is used in .p12 format. My code to register the notification is - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // Set the navigation controller as the window's root view controller and display. deviceToken = nil; self.window.rootViewController = self.navigationController; [self.window makeKeyAndVisible]; [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; [[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert]; return YES; } - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken { UIAlertView *alertView=[[UIAlertView alloc]initWithTitle:@"Succeeded in registering for APNS" message:@"Sucess" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alertView show]; [alertView release]; deviceToken = [devToken retain]; NSMutableString *dev = [[NSMutableString alloc] init]; NSRange r; r.length = 1; unsigned char c; for (int i = 0; i < [deviceToken length]; i++) { r.location = i; [deviceToken getBytes:&c range:r]; if (c < 10) { [dev appendFormat:@"0%x", c]; } else { [dev appendFormat:@"%x", c]; } } NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; [def setObject:dev forKey:@"DeviceToken"]; [def synchronize]; NSLog(@"Registered for APNS %@\n%@", deviceToken, dev); [dev release]; } - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { NSLog(@"Failed to register %@", [error localizedDescription]); UIAlertView *alertView=[[UIAlertView alloc]initWithTitle:@"FAILED" message:@"Fail" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alertView show]; [alertView release]; deviceToken = nil; } - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { NSLog(@"Recieved Remote Notification %@", userInfo); NSDictionary *aps = [userInfo objectForKey:@"aps"]; NSDictionary *alert = [aps objectForKey:@"alert"]; //NSString *actionLocKey = [alert objectForKey:@"action-loc-key"]; NSString *body = [alert objectForKey:@"body"]; // NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:[self.navigationController viewControllers]]; // // if ([viewControllers count] > 2) { // NSRange r; // r.length = [viewControllers count] - 2; // r.location = 2; // [viewControllers removeObjectsInRange:r]; // // MapViewController *map = (MapViewController*)[viewControllers objectAtIndex:1]; // [map askDriver]; // } // // [self.navigationController setViewControllers:viewControllers]; // [viewControllers release]; //NewBooking,"BookingId",Passenger_latitude,Passenger_longitude,Destination_latitude,Destination_longitude,Distance,Time,comments NSArray *arr = [body componentsSeparatedByString:@","]; if ([arr count]>0) { MapViewController *map = (MapViewController*)[[self.navigationController viewControllers] objectAtIndex:1]; [map askDriver:arr]; [self.navigationController popToViewController:[[self.navigationController viewControllers] objectAtIndex:1] animated:YES]; } //NSString *sound = [userInfo objectForKey:@"sound"]; //UIAlertView *alertV = [[UIAlertView alloc] initWithTitle:actionLocKey // message:body delegate:nil // cancelButtonTitle:@"Reject" // otherButtonTitles:@"Accept", nil]; // // [alertV show]; // [alertV release]; } Can anyone help me out with this issue. Why notification received on iOS4.3 device but not on iOS5? Thank you very much!!! in advance

    Read the article

  • How can I handle unread push notifications in iOS?

    - by Bartserk
    I have a iOS 5.1 application that registers to the APNS service to receive notifications. The register is successful and I receive the notifications correctly. The problem comes when I try to handle the notifications. Once the application is running, the method didReceiveRemoteNotification in the AppDelegate is called correctly and so the notification is handled as intended. This, however, only happens when the application is running on the foreground. However, when the application is running on the background or is simply stopped, that method is not called. I've read that you should add some lines to the method didFinishLaunchingWithOptions method to obtain the notification from the userInfo dictionary, and handle it. This works just fine, but ONLY when the application is opened by clicking on the notification at the Notification Center. This means that if you open the application by clicking on its badge, or simply by changing context if you were running it on the background, the app never realises that a notification came in. Additionally, if more than one notification was received, we can only handle one of them at once by clicking on the Notification Center, which is a pain :-) Is there any way to read the pending notifications in the Notification Center? I know there is a way to flush them using the method cancelAllLocalNotifications but I haven't found a way to just read them. And I really need to handle all of them. I thought of implementing a communication protocol with the third-party notification server to retrieve the information again when the application comes to the foreground, but since the information is already in the operating system I would find it strange if it's impossible to access it somehow. So, does anybody know a way to do it? Thanks in advance.

    Read the article

  • iPhone App IDs and Provisioning... Does App ID get used instead of provisioning ID if I decide to us

    - by Jann
    This is a question that has been bugging me for a while. I started my app (now submitted -- not yet approved) not wishing to get into the mess that is APNS (Push). I did the following: iPhone Developer Center: Provisioning Portal-Provisioning: Then I created a Development and a Distribution Provisioning Profile. I installed both in XCode. Everything hunky dory. The Development profile scares me a bit by expiring so soon (90 days) but I can remove it from the iPhone(s) and sign it with a new one later. I tested using the Development profile, and later to submitted it by signing it with the Distribution profile. I then uploaded the Distribution profile-signed app to iTunesConnect (app store). Okay, I understand that much. Now, what I don't understand is this: Now that I understand the theories and methods behind how Push works, I am wishing to add it to my app. I already went under: iPhone Developer Center: Provisioning Portal-App IDs: and created a Development Provisioning Profile and Distribution Provisioning Profile there (push & in-app purchase enabled). Here is where it gets confusing to me. All the books and docs I have read say that I have to sign the app with this "App ID" provisioning profile (push-enabled) from now on. Does that mean I no longer ever use the previously created provisioning profiles? If I were to import these "App ID" provisioning profiles into Xcode they will exist alongside my previously generated "non-push" profiles. ~/Library/Mobile Devices/Provisioning Profiles now has 2 files. One Devel and one Distrib. It will now have 4 even though for this app I will not use the "non-push" anymore right? (actually, since they are locked by using bundle-codes and app ids i will never use it again if all of my further versions of this app use Push?) Confused. Can anyone enlighten me? Why not use the "App ID" profiles in the first place for everyone -- even if you are not gonna use push? Would keep it simpler. Should I only generate "Push Enabled" profiles from now on -- even if i am not sure I am gonna use push (or for that matter in-app purchase)? Please give me some insight. I do not wanna do this wrong. Thanks! Jann

    Read the article

  • Apple Push Notifications With Foreign Accent Characters Not Receiving

    - by confeng
    I'm sending push notifications and when the message contains foreign characters (Turkish in my case) like I, s, ç, g... The message does not arrive to devices. Here's my code: $message = 'THIS is push'; $passphrase = 'mypass'; $ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', 'MyPemFile.pem'); stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase); // Open a connection to the APNS server $fp = stream_socket_client( 'ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx); if (!$fp) exit("Failed to connect: $err $errstr" . PHP_EOL); echo 'Connected to Apple service. ' . PHP_EOL; // Encode the payload as JSON $body['aps'] = array( 'alert' => $message, 'sound' => 'default' ); $payload = json_encode($body); $result = 'Start'.PHP_EOL; $tokenArray = array('mytoken'); foreach ($tokenArray as $item) { // Build the binary notification $msg = chr(0) . pack('n', 32) . pack('H*', $item) . pack('n', strlen($payload)) . $payload; // Send it to the server $result = fwrite($fp, $msg, strlen($msg)); if (!$result) echo 'Failed message'.PHP_EOL; else echo 'Successful message'.PHP_EOL; } // Close the connection to the server fclose($fp); I have tried encoding $message variable with utf8_encode() but the message received as "THÝS is push". And other ways like iconv() didn't work for me, some of them cropped Turkish characters, some didn't receive at all. I also have header('content-type: text/html; charset: utf-8'); and <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> in my page. I don't think the problem appears while I set the value but maybe with pack() function. Any ideas to solve this without replacing characters with English?

    Read the article

  • Apple Push Notification-Unable to callback didRegisterForRemoteNotificationsWithDeviceToken

    - by Shailesh Kanzariya
    I have been simply trying to get deviceToken from my iPhone application using Apple Push Notification Service. I don't have any implementation on server side for the time being. I have created APP Id, got SSL certificate, Provision Profile with APN and calling - (void)applicationDidFinishLaunching:(UIApplication *)application { //view init and add sub view to window [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound]; } method. When I execute the application it pop ups action box to allow Push Notification (means my request for APN registration is working) but my callback is not executed. Neither didRegisterForRemoteNotificationsWithDeviceToken nor didFailToRegisterForRemoteNotificationsWithError is called? can anybody help me to resolve the issue? Following are my callbacs for reference. - (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err { UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@"APNClient" message:@"Entered into Error Method" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [myAlert show]; [myAlert release]; NSLog(@"Error in registration. Error: %@", err); } - (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken { UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@"APNClient" message:@"Got the deviceToken..!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [myAlert show]; [myAlert release]; }

    Read the article

  • Push Notification (duplicate?)

    - by Moshe
    I've seen other questions here about PNS, in terms of code, but how does the concept work?do I need to tell my client that they need a server? What goes in the server in terms of configuration/cron or whatever? Please explain the process. Thanks a ton. EDIT: Please explain: Do I need to purchase an SSL certificate, or does Apple issue a "client" or " app" SSL certificate for me?

    Read the article

  • iPhone SDK Push notification randomly fails

    - by Jameson
    I have a PHP file with the following content that works perfectly on development ceritficates, but when I switch to a production certificate the PHP errors and gives the below message, but it only does this about 50% of the time. The other 50% it works. Anyone know why this might be happening? <?php // masked for security reason $deviceToken = 'xxxxxx'; // jq $ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', dirname(__FILE__)."/prod.pem"); $number = 5; $fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx); if (!$fp) { print "Failed to connect $err $errstr\n"; } else { print "Connection OK\n"; $msg = $_GET['msg']; $payload['aps'] = array('alert' => $msg, 'badge' => 1, 'sound' => 'default'); $payload = json_encode($payload); $msg = chr(0) . pack("n",32) . pack('H*', str_replace(' ', '', $deviceToken)) . pack("n",strlen($payload)) . $payload; print "sending message :" . $payload . "\n"; fwrite($fp, $msg); fclose($fp); } ?> The PHP error: Warning: stream_socket_client() [function.stream-socket-client]: Unable to set local cert chain file `/var/www/vhosts/thissite.com/httpdocs/prod.pem'; Check that your cafile/capath settings include details of your certificate and its issuer in /var/www/vhosts/thissite.com/httpdocs/pushMessageLive.php on line 19 Warning: stream_socket_client() [function.stream-socket-client]: failed to create an SSL handle in /var/www/vhosts/thissite.com/httpdocs/pushMessageLive.php on line 19 Warning: stream_socket_client() [function.stream-socket-client]: Failed to enable crypto in /var/www/vhosts/thissite.com/httpdocs/pushMessageLive.php on line 19 Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in /var/www/vhosts/thissite.com/httpdocs/pushMessageLive.php on line 19 Failed to connect 0

    Read the article

1 2 3  | Next Page >