-1

I have implement remote notification in ios 8. In this notification I have two button?

1 ) When I click on End Call Then I want to send signal to other device.

2) When I click on Accept Then I want to send signal to other device.

See following screenshot for better understand

Notification Screen

when i tap notification display following screen .

Main Screen

When I open Main Screen working fine.

following is my code for notification button tap buttons.

   - (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void (^)())completionHandler {

DoctorNotificationViewController *DoctorNoti = [[DoctorNotificationViewController alloc]initWithNibName:@"DoctorNotificationViewController" bundle:nil];
  if ([identifier isEqualToString:NotificationActionOneIdent])
    {

        [DoctorNoti btnAcceptPressed:0];


    }
    else if ([identifier isEqualToString:NotificationActionTwoIdent])
    {
       [DoctorNoti btnRejectPressed:0];

    }
     [self.navcntrl pushViewController:DoctorNoti animated:YES];  

}

Any help will be appreciate.

Maulik shah
  • 1,664
  • 1
  • 19
  • 45

1 Answers1

0
  • You can send signal by this method [OTSession signalWithType:string:connection:retryAfterReconnect:error:]

  • And receive by this [OTSessionDelegate session:receivedSignalType:fromConnection:withString:]

UPDATE: For handling background remote notification, I think it's related to iOS more than Tokbox. Found an interesting article: https://medium.com/posts-from-emmerge/ios-push-notification-background-fetch-demystified-7090358bb66e#.3cb8p9x6n.

Lucas Huang
  • 3,998
  • 3
  • 20
  • 29