In my implementation of the nib, I followed very closely the encapsulation guide detailed in an eppz blog post. (But fortunately you get an error that says something to the nature of "missing NSExtensionPrincipalClass") Placing it anywhere else will result in Xcode being unable to run your extension in the simulator or other device. Note that this key is a direct sibling of the NSExtension key that already exists in the plist. Add a new key to the extension's plist called NSExtensionPrincipalClass and set it to the name of your nib's class.Remove the reference to MainInterface.storyboard in your extension's General tab.If you elect to use a nib, there's just a bit of configuration that needs to be done in the extension's project settings. The share extension template includes a storyboard that you can use to design the flow of your extension (if you plan on having multiple views), but you can also just have a single view represented by a nib, as I did. The rest of the customization is exactly how you would create and present a custom view in any other context. That is, if Apple allows for such a design to even get through its approval process. would be nice if someone can confirm this from Apples changelog somewhere. I guess Apple definitely has changed how the share intent list is fetched and displayed on the apps. So, performing unnecessary UI instatiating and drawing might result in your extension just not running at all. Even inside my app, I have a function to share my app content with other apps, I dont see my app on the app list to share the content (Im using the share package). Your app extension doesn’t own the main run loop, so it’s crucial that you follow the established rules for good behavior in main run loops. the system may aggressively terminate extensions because users want to return to their main goal in the host app. Memory limits for running app extensions are significantly lower than the memory limits imposed on a foreground app. On top of that, an extension doesn't own the main run loop and iOS "aggressively" terminates extensions that are taking too long or block the main loop. An extension that launches too slowly is terminated by the system. otherwise my extension hovers at about 3MB).ĭesign your app extension to launch quickly, aiming for well under one second. What about just drawing your custom view on top of the existing one? Yea, that might work, but the issue here is that the Apple guidelines require that extensions take much less than one second to load, and that its memory footprint minimal (I received low memory warnings at about 5MB when I accidentally entered an infinite loop by overriding loadView of SLComposeServiceViewController. And on top of that, the view itself has a nested structure of CALayers that's just a pain to go through and draw out. To debug and or test, run the scheme associated with your app. You can access, for example, the view that the SLComposeServiceViewController presents. You may be thinking: "Wait, isn't there a way to modify the existing view so that you don't have to completely re-code basic functionallity?" And the answer to that is no. #import ShareViewController : in order to have a fully customized view, you'll need to change the class's inheritence to that of UIViewController, its direct super class, and delete all of the SLComposeServiceViewController-specific methods. didSelectPost, isContentValid, and configurationItems) //header file for SLComposeServiceViewController To give a sense of where we started, to where we are going, this is our roadmap:Īs previously mentioned, an out-of-the-box implementation of a share extension gives you (among other things) a template of a SLComposeServiceViewController, which includes some default methods that you need to override (ie. I'll be improving that existing extension by replacing its default SLComposeServiceViewController with a UIViewController and adding in a custom view. In the last post, I took a look at how to share data between a share extension and its container app. Public class MainActivity extends ReactActivity else if attachment.Menu Extensions in iOS8: Custom Views 25 January 2015 on iOS8, nibs, extensions, autolayout android/app/src/main/java/com/YOUR_APP/MainActivity.java : On MainActivity on your react-native app.Note: Ios and Android on Debbuging time not working at sometimes while App is Closed Android $ react-native link react-native-receive-sharing-intent Installation Npm $ npm install react-native-receive-sharing-intent -save Yarn $ yarn add react-native-receive-sharing-intent ios $ cd ios & pod install Mostly automatic installation less than React Native 0.60.0 Check the provided example for more info. react-native-receive-sharing-intentĪ React Native plugin that enables React Native apps to receive sharing photos, videos, text, urls or any other file types from another app.Īlso, supports iOS Share extension and launching the host app automatically.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |