I have adapted this code from How to use device tokens in different ways in iphone?
- (void)sendProviderDeviceToken:(NSString *)tokenString {
NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];
NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier];
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
NSString *data = [NSString stringWithFormat:@"udid=%@&token=%@&id=%@&type=%i", udid, tokenString, bundleID, type];
NSString *escapedData = [[data description] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString *httpRequestURLString = [NSString stringWithFormat:@"http://%@/RegisterDevice.cgi?%@", kRegistrationURI, escapedData];
NSURL *httpRequestURL = [NSURL URLWithString:httpRequestURLString];
}
and the code works correctly when the device is tethered but as soon as I disconnect the device it stops working.
Clearly there is something I am missing but it is not obvious
This is my first question here. I hope I am following proper form ...