我正在使用
适用于iOS的Twilio Voice Objective-C快速入门
#pragma mark - PKPushRegistryDelegate
- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type {
NSLog(@"pushRegistry:didUpdatePushCredentials:forType:");
if ([type isEqualToString:PKPushTypeVoIP]) {
self.deviceTokenString = [credentials.token description];
[[PhoneCallModel sharedInstanse] getAccessTokenResponse:^(NSString *accessToken) {
[[TwilioVoice sharedInstance] registerWithAccessToken:accessToken
deviceToken:self.deviceTokenString
completion:^(NSError *error) {
if (error) {
NSLog(@"An error occurred while registering: %@", [error localizedDescription]);
}
else {
NSLog(@"Successfully registered for VoIP push notifications.");
}
}];
}];
}
}
PKPushRegistry
)方法
- (void)pushRegistry:(PKPushRegistry *)registry didInvalidatePushTokenForType:(PKPushType)type
没有打电话,试了很多次。
registerWithAccessToken