在appDelegate实现文件里面。复写此方法: 保存到本地路径: #define DEST_PATH_DeviceToken [NSHomeDirectory() stringByAppendingString:@"/Library/Preferences/deviceToken.plist"] - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { //NSLog(@"My Token is %@",deviceToken); //转换成string NSString* dvsToken =[[deviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSetcharacterSetWithCharactersInString:@"<>"]]; NSLog(@"My dvsToken is %@",dvsToken); //============保存dvsToken=========================== NSMutableDictionary* dvsTokenDictionary = [NSMutableDictionary dictionary]; [dvsTokenDictionary setObject:dvsToken forKey:@"dvsToken"]; //将dvsToken存入本地 [dvsTokenDictionary writeToFile: DEST_PATH_DeviceToken atomically:YES]; }