Android how to get results from another app - android

I have seen some apps that take me into a web page and after reach certain endpoint the browser closes itself automatically then I continue in the original app.
Another app that takes me to my SMS messaging app then autofill the textbox and when I click send, again the same thing happens the SMS app closes itself and then continue in the original app, how can I get the results of those intents.
In both cases, the app returns with data received I think it's from the backend

Have a look at Android deeplinks
Basically you create some deeplink for your app like yourapp://awesomeintent and the website calls this link. In your AndroidManifest.xml you register some activity for this deeplink with the help of intent-filters and then your app pops up as soon as any other app/website opens your deeplink.
Keep in mind: If the user has more than 1 app which can process the deeplink, Android will ask him which app he wants to choose to do so.

Related

Receiving notification of an Android app through another app

I was wondering if it is possible to receive the notifications and messages of one app (e.g. WhatsApp) via another app (user developed app) without changing anything in the source app and sending back the user response to the source application (WhatsApp).
I tried to do this in IOS but IOS does not allow such interactions between the applications.

Android Messaging, Email app behavior when starting app from a link

I am working on the capability of starting an app via an SMS link or an email. It is all working fine. Custom links don't parse on Android phones, but that is another story. My http style link works great. But the issue is the behavior of apps like Messaging, Android GMail App, Android Mail app, Android Outlook app, Whatsapp, etc. ( Here is the scenario:
Go to app, like Messaging, Gmail, etc.
Click on the link to start up my app (app starts up correctly)
Hit the Home Button
Hit the icon of the app that I used to start up my own app
On Samsung phones, when I do step 4 (above), the Messaging and Outlook apps show my app, not the message or email list. The Gmail and Android Email apps behave correctly (in my opinion). These apps bring you back to where you were in that app. On my LG phone, the Messaging app behaves correctly. Whatsapp always seems to behave badly.
My main concern are messaging apps, as I want to use SMS as a way to start up my app. I think that the Messaging app should go back to the message list like my LG phone.
Is there a solution to this? Thanks
So the answer in this case is to add android:launchMode="singleTask" to the activity attribute in the manifest. Then all Messaging, Outlook, Mail, and Gmail apps all behave correctly.
Now have to figure out how to prevent the user from trying to open this app multiple times.

How to get App launch source in React Native?

Is there any method to get App launch source(from home icon or other like notification bar etc.) in RN?
Or native way?
As far as I can think of there should be 3 different launch source for an app.
Home Icon
Notification
App Link
I don't think there is a direct way of knowing what is the source of launch but what you can do is to eliminate options one by one and end up the one which is used.
For example;
First you can check for if the app is opened with an app link. You can use Linking API for this.
getInitialURL()
If the app launch was triggered by an app link, it will give the link
url, otherwise it will give null
If the app did not launched with a link then you can check for notification data. There is lots of different libraries and techniques for using notifications with react-native and most of them has an event listener for notification data. You can check for any notification data and see if you are going to get any. React-native has PushNotificationIOS for native IOS notifications. Just to give you an idea you can use getDeliveredNotifications().
getDeliveredNotifications()
PushNotificationIOS.getDeliveredNotifications(callback);
Provides you with a list of the app’s notifications that are still
displayed in Notification Center
If both of these tries return with no information or data then app must be launched from home icon.

Android- How to restrict users to be active in more than one device?

I am developing an Android application in which I would like to restrict an user to access only one device at a time.
Lets say, User A is logging in first time using the Android application and from next time,the app logs in automatically using the credentials stored in the local storage.
If the same user is logging in with the web application with the same credentials and changed the password, the mobile application should force the user to login as soon as the password is changed.Even if the mobile application is being active and doing some tasks , it has to be cancelled and force user to login once again.
My idea was to use Push Notification in Mobile app to terminate the session as soon as the user has logged in/changed the password from web application. But the bottle neck is that there is an option in device settings to block the notification.
Please help me to find a way to overcome this.
There is NO option in devices to block Push Notifications. But there is an option to stop an App from showing Notifications in the Device Notification Bar and also there is another option to stop an App from using Data (Internet) in the background (when not in use!). This is a different case with your issue.
Here is how! On your server send message to a user Device using Firebase. You should send Data Messages so as to gain full control and because you do not need to show any notification to a user device. When that message reaches to the user. You should Logout the user. Remember all this happens in the background the user does not notice anything or any notification shown.You can learn more about message types here.

Facebook request action

In my mobile application I open a facebook requests dialog and send my friends some requests. How can I achieve the following behavior? When android user opens notifications bar of his smartphone and taps my request - my application (which sent it) should open (or market should open on my application's page). Now when user taps on my request a facebook application opens.
How can I set what happens when user taps my facebook request in the notifications menu? E.g. candy crash saga requests open the market on the CCS page. My requests open the facebook app.
You mean you want to Start Another Activity that you've written?
Or, you want to launch the Facebook app from your app. Check out this question.

Categories

Resources