How do I send notifications from one app to another app? (Example: Sogou input method to download skin after the completion of the use of skin) Note: Sogou Input method is app, and keyboard is extension
When you add app extension to your app, if you want to send a notice to extension in app maybe this article will help you.
Learn More
/Send notification-(void) Postnotificaiton {cfnotificationcenterref notification = Cfnotification
Centergetdarwinnotifycenter ();
Cfnotificationcenterpostnotification (Notification, CFSTR ("<notificaiton name>"), Null,null, YES); }//Receive notification-(void) receivenotification {CFNOTIFICATIONCENTERREF notification =
Cfnotificationcentergetdarwinnotifycenter (); Cfnotificationcenteraddobserver (notification, (__bridge const void *) (self), observermethod,cfstr ("<notificaiton
Name> "), NULL, cfnotificationsuspensionbehaviordeliverimmediately); } void Observermethod (Cfnotificationcenterref center, void *observer, cfstringref name, const void *object, Cfdictionaryr EF userInfo) {//Your Custom Work}//removal notification-(void) removenotification {cfnotificationcenterref notification = Cfnoti
Ficationcentergetdarwinnotifycenter (); Cfnotificationcenterremoveobserver (notification, (__bridge const void *) (self), cfstr ("<notificaiton name>"),
NULL); }
The above gives you a brief introduction of how iOS in the Host app and app Extension to send the relevant content of the notice, I hope to help you!