这是一个示例,不一定是工作代码:
- (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];
}