React Native (or alternative) that supports native "share via" feature - android

I need to create a wrapper app. Basically it is just a webview pointed to our online hosted react app. It must build to both iOS and Android. Therefore I have considered using plain react native.
Most important feature is that the app must be registered on the device as an app that can handle links when using the native "share" feature.
Example; if I do a google search in chrome/safari/whatever I am able to press-hold any of the links (search results) I can then click "share" this will normally open a menu with lets say share to; "drive", "gmail", "messenger", "sms".... etc. I want our wrapper app to show up in the menu and be able to handle the link.
I have tried to search for libraries/frameworks that makes this possible. But all search result I am getting seems to be explanation on how to do the opposite thing, opening the native share menu from within the app.
I have been looking at expo, but can't figure out if they support this feature, otherwise I would consider create-react-native-app which is react-native based, but I am also not able to find direct documentation on how to implement such feature.
Further more, I know that there is a unity plugin that will do this, and that I could combine it with a uniWebView which would handle the wrapper app part.
How can I achieve a native share to feature on a simple wrapper app that builds to both iOS and Android?

You won't be able to do that in react native on Android because its not part of the native code. Its part of the manifest. You need to follow the instructions at https://developer.android.com/training/sharing/receive and set up an intent filter in your manifest telling the OS your app handles the correct mime type, and what activity to send it to. That activity would then have to handle the incoming data, either directly or by sending it to react native (which is going to be at least a mild pain, RN is ok when you want it to display a isolated view or want it to call a native module, calling RN code isn't very easy). This doesn't mean your app can't use react native, but that you'll need to modify the default manifest it creates.
If that's a major usecase of your app and your app is 90% just displaying your webpage, you may have an easier time of things not using react native and just displaying a web view. (I'll leave my bias of RN just being a horrible solution for everything at the door here).

Related

Crossplatform Plugin architecture with MAUI

My goal is to create app on Android/Windows using MAUI, and as I want to be able to add to this app more functionality by plugins, I want to create some simple plugin system.
This plugins should be able to subscribe to domain events, add components (like menu items and "pages" components that will be shown in app after menu click), communicate with each other.
So, is there any way to do it cross-platform?
If it was only windows, I would just create plugins dlls, on app start up I need to load them, find every IPlugin or similar, initialize them, etc.
But where to store it on Android? How to compile/load this plugins on Android? (and in future not only Android, but iOS & Mac too)
P.S. I'm super new to MAUI stuff, and need to learn a lot, so appreciate full answers
P.P.S. Not a native English speaker, sorry for mistakes

React Native - Open the device default gallery app

I'm developing a camera for a React Native app, and it needs to include a button to open the device gallery app (gallery for android, camera roll for iOS). All photos are stored in a specific album, so it would be better to open the app in that album, if possible, but it's not mandatory. It's worth noting that I don't want to create a custom in-app gallery. That would actually be easier, but it's not what the client asked for.
It seems to be a pretty simple task, but I haven't found a way to do this yet. Some people suggested using linking, like this:
Linking.openURL('content://media/internal/images/media');
This makes the OS ask the user what app should be used to open that link. If I select Google Photos, it works fine. However, if I use the default android gallery, it opens a photo that doesn't exist, showing a placeholder image. So this method doesn't work reliably.
According to android docs, it should be possible to open the gallery app by using an intent. But I tried doing both:
Linking.sendIntent('CATEGORY_APP_GALLERY');
Linking.sendIntent('android.intent.category.APP_GALLERY');
and it didn't work. Either I'm doing something wrong, or sendIntent doesn't work at all.
There's also a plugin called "react-native-send-intent", but it doesn't include a function to open the gallery. I'm running out of ideas, any help would be appreaciated.
I had the same issue in my personal project.
According to the doc, CATEGORY_APP_GALLERY is just specifying app categories and must be used with the ACTION_MAIN action.
As far as I understand, we cannot pass a category via React Native built-in Linking.sendIntent() method, unfortunately. We must rely on third-party libraries on that part.
I picked up expo-intent-launcher (If you are not using expo, still you can use it by following bare workflow as it's described in the doc).
Here is a working snippet example with expo-intent-launcher:
import * as IntentLauncher from 'expo-intent-launcher';
IntentLauncher.startActivityAsync('android.intent.action.MAIN', {
category: 'android.intent.category.APP_GALLERY',
})

Android - HTML5 custom LAUNCHER

I want to create my custom android launcher but not with java code. I want to create it with HTML5 code. I've seen some launchers with HTML5 but not the documentation. Does anyone can give me some links or some tutorials/documentation to start? Thanks.
Does anyone can give me some links or some tutorials/documentation to start?
You could define much of the UI as HTML/CSS/JavaScript. Via PhoneGap, you could deploy this as an app. However, you will still need Java code -- or perhaps a PhoneGap plugin, if someone has written one -- to be able to access information about the installed apps, in order to populate your launcher.

mobile multiplatform development with native UI

i have developed an app, running on iphone and android, using phonegap and jquery mobile.
The combination of them is really great.
To support multi platform, I have also evaluated some other platforms too, but the problem that i have is that the UI does not feel native (and although not a problem for most apps performance cannot be compared with native).
The only solution so far giving acces to native UI seems to be monotouch.
Do you have any suggestions on platforms offering native ui at least on iphone and android, regardless of language used?
Thanks.
The only way to have native UI response is to write native apps.
The native UI is a puzzle indeed. You need read HIG firstly, cook UI with color and images to get close with system default ones. But if you are using PhoneGap thing, why do you even worry about it? Just rely on framework to get close the look and feel. Get your app really useful is more attractive than looking accustomed for user.
But it is important to adjust interactive design to avoid conflict. For example iOS navigation bar has return button in left most part, don't put it at right. And Android user will get disappoint if there is no response for long pressing or context menu key pressing.
for now i will go with a mixed on js based on phonegap and native controls plugin which i will extend as needed.

Is there Android Intent concept in iPhone SDK

Just switching from Android to iPhone. In Android I can make several apps and use a tabView to call each app as intent.
In iPhone, I can make several apps. I need a tab to call each apps or app views. Is there similar concept as intent in iPhone? Just switched to iPhone, copying all the other projects into the tabbar does not work out. If you have other methods to solve, I really appreciate. Thanks,
Android and iOS are very different in this regard. Android is very open about letting you use intents to mix and match activities from other apps. iOS isn't like that; each app runs in its own private space and generally cannot even see other apps' data, let alone use their services. It is possible to cause other apps to run via custom URLs, but that's not the same thing.
What you'll need to do is to copy or move the code for the view controllers, views, etc. of your various iOS apps into your tab bar app project. You'll build them all into a single application, and the tab bar will switch between the view controllers.
With iOS 8 you will have something similar to Android Intents. Using App Extensions you can reach similar behavior.
In a close future Apps will start expose their "extension" (as you do in Android Framework declaring Intent Filters in the manifest) that will be used by application who need.The extension areas allowed in this first version are:
Today
Share
Action
Foto Editing
Document Provider
Custom Keyboard
It's great finally apple release this functionality!
Intent in Android covers a lot of functions. There is no iOS equivalent to that.
But if your objective is to launch a different app, and pass parameters to it, you can try out URL Schema.
Let's say you have app AAA with URL schema aaa:// and app BBB with URL bbb://
You can launch app AAA, and call bbb://v=1&c=2 for example, to launch BBB and get the parameters. you can even take these parameters to control what view to show, so you can have a similar concept in Android, to call different Activity with Intents.
You have to register URL schema in Info.plist
The closest concept to an Intent on iOS is the handling of certain URLs by the system applications. See here. It was possible to register your own application URL schemes at one point (see this article), but I must admit I haven't tried this in recent SDKs (IIRC Glympse links can be opened in the Glympse app, so this technique probably still works).
As of 2016, Apple has added an Intents framework that is similar to Android's, albeit much more restrictive. Expect Apple to add more Intents in the future, but for now it is quite limited. https://developer.apple.com/reference/intents
Since iOS 8, you can use App Extensions.

Categories

Resources