Private Sub Application_Start (Nav As NavigationController)
Dim no As NativeObject =Me
no.RunMethod("voipRegistration",Null)
End Sub
#IF OBJC
#import <PushKit/PushKit.h>
// Register for VoIP notifications
- (void) voipRegistration {
dispatch_queue_t mainQueue = dispatch_get_main_queue();
PKPushRegistry * voipRegistry = [[PKPushRegistry alloc] initWithQueue: mainQueue]; // Create a push registry object
voipRegistry.delegate = self; // Set the registry's delegate to self (self or self.bi?)
voipRegistry.desiredPushTypes = [NSSet setWithObject:PKPushTypeVoIP]; // Set the push type to VoIP
NSLog(@"====voipRegistration);
}
// Handle updated push credentials
- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials: (PKPushCredentials *)credentials forType:(NSString *)type {
// Register VoIP push token (a property of PKPushCredentials) with server
NSLog(@"token=%@ type=%@",credentials.token, type);
}
// Handle incoming pushes
- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type {
// Process the received push
NSLog(@"====pushRegistry Receive");
NSLog(@"%@",payload.description);
}
#End If