ios - WatchConnectivity sendMessage:replyHandler: don't work when linker have flag -ObjC -
i have project external libraries, project use -objc linker flag these libraries. without -objc project crash. , want add support watch os 2. have problem: until linker has flag -objc method -sendmessage:replyhandler: return error like
error domain=wcerrordomain code=7014 "payload not delivered." userinfo={nslocalizeddescription=payload not delivered.}
i can't delete flag (-objc), watch doesn't work. if user tap @ button need send info iphone. , ways sending info have problems too. system add messages queue , keep them forever. have ideas ?
linker flag should not effect watchkit connectivity. here several troubleshooting procedures.
- you have make sure delegate method implemented on device receives message.
-(void)session:(wcsession *)session didreceivemessage:(nsdictionary<nsstring *,id> *)message
in comments, said data sending simple dictionary. watchkit connectivity doesn't allow send custom class objects.
also try restart simulator or device. simulators, watchkit connectivity fails. rebuild , restart help.
these usual mistake people make (or made) wathkit connectivity. no code should block watchkit connectivity. please read apple's documentation closely specifics of delegates , protocols. let me know if have questions. luck!
Comments
Post a Comment