In our mobile app, we want to check if an app like twiiter or instagram has been installed or not. How to achieve this ?
In android, we can find using the following line:
PackageInfo info= getPackageManager().getPackageInfo("com.twitter.android", 0);
How to achieve the same in Outsystems ?
Hello, Kartick,
From my understanding, the plugin uses an asynchronous callback to return its results. As such, you will need to use '$resolve()' to make the JS node hold the execution of the client action until it is called, as described here.
There should be a similar pattern on the Location plugin's 'WatchPosition' action, so you could download it and check its code.
Please let me know how it went.
Best regards,
Carlos Simões
This is kind of an advanced scenario, so I'd look for a plugin to achieve it.
Have you had a look at this plugin? It looks like it supports Id lookup for Android and scheme-based lookup, which our OutSystems Mobile apps include.
Please let us know if it solved it for you!
Thanks Carlos, your reply was helpful.
From the link that you shared, I created a new mobile application, then created blank module, added the following in the "Extensibility Configurations"
{ "plugin": { "url": "https://github.com/ohh2ahh/AppAvailability.git" }}
Then created a client action, added a java script with the following code:
$parameters.Exists='false';
appAvailability.check( 'com.twitter.android', // Package Name
function() { // Success callback
$parameters.Exists='true'; },
function() { // Error callback
$parameters.Exists='error'; });
Then I have an assign to assign the Exists parameter to the out parameter.
When I called the client action from another application, the value of "Exists" is "false" even though the twitter app is installed on the phone. Why is the plugin not working ?
Thanks Carlos, it worked fine after implementing asynchronous callback.
Can I post the application to forge, so that others can use it ?
Hi Kartick,
Make it available on the forge, that would be great.
Thank you!
Sure Daniel, thanks.
Carlos,
It is not working for iOS. Any idea why ?
I saw in documentation that for iOS, the following has to be done:
Simply open your app's .plist (usually platforms/ios/<appname>/<appname>-Info.plist) with an editor and add the following code with your needed Schemes.
platforms/ios/<appname>/<appname>-Info.plist)
<key>LSApplicationQueriesSchemes</key> <array> <string>twitter</string> <string>whatsapp</string> </array>
But how to do this in outsystems ?
how to add .plist file for iOS using outsystems.
Hi,
Is there any way where we can detect from a web page whether the apps(facebook, messenger, instagram) were installed?
Thanks in advance.
In OutSystems you can achieve this using the AppAvailability plugin from the Forge. It provides a IsAppInstalled client action that takes the app URI scheme as input and returns a boolean telling you whether the app is installed on the device. For Instagram the URI scheme is instagram and for Twitter it is twitter. You simply drag the IsAppInstalled action into your client action flow, pass the URI scheme as a parameter, and check the output boolean to determine whether the app is present on the device. The plugin works for both Android and iOS so you do not need separate implementations for each platform. This is particularly useful if you are building a feature that detects Instagram availability and then redirects users to a browser based alternative like snapinstaink for media retrieval when the native app is not installed. Make sure to install the plugin from the OutSystems Forge and add it as a dependency in your application before using it.
I’ve worked with social platforms such as Instagram in a few web projects, and I found that the app detection approach can differ quite a bit between Android and cross-platform frameworks. For example, with Indown.mobi I’ve focused more on browser-based Instagram functionality, while native app detection needs to rely on the platform APIs and OutSystems capabilities.
I’ve also been curious about how apps like Instagram are detected on mobile platforms, especially when building features that interact with social media content.