Share Extensions are used to share Audio, Video, Photos, Comments, Links etc, from supported app. In case of web content an app can specify the two types of input i.e; Web URL and Web Page. Web URL is simply the current URL as a string but the Web Page is full HTML of the shared page based on the JS provided by the host app.
Basic requirments to register an app for sharing;
NOTE:For Share Extensions we should use NSURLSession to perform server data transfears the reason being your extension does not live beyond its presentation.
Basic settings of SLComposeServiceViewController;
Basic requirments to register an app for sharing;
- Display Name - CFBundleDisplayName
- Activition Rules - Inform the iOS about what kind to data they support to share, based on the same iOS will select the app to be shown in sharing menu. App should have appropriate information in ".plist" file @ NSExtension -> NSExtensionAttributes -> NSExtensionActivationRule. There are two ways to supply this information, i.e;
- Predicates - A complex or simple predicate with supported types, in this case NSExtensionActivationRule will be string type
- Condensed - A simple list of supported sharing types, in this case NSExtensionActivationRule will be dictionary type
- ViewController - App need to provide a ViewController subclassed with SLComposeServiceViewController which will be displayed at the time of sharing
NOTE:For Share Extensions we should use NSURLSession to perform server data transfears the reason being your extension does not live beyond its presentation.
Basic settings of SLComposeServiceViewController;
- PhotoBlogCharacterLimit - for max length of share message size
- PhotoBlogTmageDataMaxSize - for max image size
- - (BOOL)isContentValid method to return the runtime validation result, return false will disable the Post button
- - (NSArray *)configurationItems Returns configuration items to display in the compose view.
- AudiencePickerViewController/Delegate need to be implimented for privacy setting (Optional)
Post a Comment