ios - Is it possible to wake up iPhone app from watchOS 3 app? -


is possible wake iphone app watchos 3 app?

the first part of code enough on watchos 2 both parts of code don't work on watchos 3:

initialization:

if ([wcsession issupported]) {     wcsession* session = [wcsession defaultsession];     session.delegate = self;     [session activatesession]; } 

on method:

if ([wcsession issupported]) {     wcsession* session = [wcsession defaultsession];     if (session.reachable) { // <-- returns false         nsdictionary *message = @{@"action":@"wakeup"};         [session sendmessage:message replyhandler:nil errorhandler:nil];     } } 

apple suggested following code:

- (void)session:(wcsession *)session activationdidcompletewithstate:(wcsessionactivationstate)activationstate error:(nserror *)error {     if ([wcsession issupported]) {         wcsession* session = [wcsession defaultsession];         if (session.activationstate == wcsessionactivationstateactivated) {             nsdictionary *message = @{@"action":@"wakeup"};             [session sendmessage:message replyhandler:nil errorhandler:nil];         }     } } 

Comments

Popular posts from this blog

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -

php - Autoloader issue not returning Class -