Breaking News
Home / iOS (page 20)


What all environments are provided by Apple for Push Notifications?

   * Sandbox: The sandbox environment is used for initial development and testing of the provider application. It provides the same set of services as the production environment, although with a smaller number of server units. The sandbox environment also acts a virtual device, enabling simulated end-to-end testing. You access …

Read More »

How to print values in NSUserDefaults to the NSLog?

Solution NSUserDefaults is basically kind of hashmap(dictionary) that stores the keys and values. In order to print all the keys do the follow:NSLog(@”%@”, [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allKeys]); In order to print both the keys & values do the follow:NSLog(@”%@”, [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]); [pb_builder]

Read More »

How to find plist file for your iPhone app on Mac?

Solution The plist for you application is located under the Library/Preference folder of your application inside the iPhone simulator application folder structure. The path to all the applications in he iPhone simulator is. /Users/[your user name]/Library/Application Support/iPhone Simulator/User/Applications Underneath this there will be a bunch of application GUID, one for …

Read More »

How to get Device token when registered for PushNotification in iOS?

Solution  – (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {     NSLog(@"My token is: %@", deviceToken);               NSString * deviceTokenString = [[[deviceToken description]                                  stringByTrimmingCharactersInSet:[NSCharacterSetcharacterSetWithCharactersInString:@"<>"]]                 …

Read More »

How to convert Device ID as NSData to NString in IOS?

Solution  (NSString *)convertTokenToDeviceID:(NSData *)token {  NSMutableString *deviceID = [NSMutableString string];  // iterate through the bytes and convert to  hexunsigned char *ptr = (unsigned char *)[token bytes];    for (NSInteger i=0; i < 32; ++i) {   [deviceID appendString:[NSString stringWithFormat:@"%02x", ptr[i]]];  }     return deviceID; } [pb_builder]

Read More »
Advertisment ad adsense adlogger