Important: In this example I only need WhatsApp, WhatsApp Business and Telegram. On Android WhatsApp (com.whatsapp) and WhatsApp Business (com.whatsapp.w4b) have different identifiers, I have not found the #QueriesSchemes for WhatsApp Business. If you know him, please leave a message so I can edit the post again and add it to the example.
Prerequisites for Android (B4A)
Prerequisites for iOS (B4I)
GitHub - iOS URL Schemes
Another GitHub (Use search, it's a mess) - Reference: List of iOS App URL Scheme Names & Paths for Shortcuts
Attention: #QueriesSchemes maximum 50 items, more info:
www.b4x.com
Prerequisites for Android (B4A)
In manifest editor add:
AddManifestText(
<queries>
<package android:name="com.whatsapp"/>
<package android:name="com.whatsapp.w4b"/>
<package android:name="org.telegram.messenger"/>
</queries>
)
Prerequisites for iOS (B4I)
In main module:
#Region Project Attributes
#ATSEnabled: True 'Change to true if its current value is false
'WhatsApp
#QueriesSchemes: whatsapp
'Telegram
#QueriesSchemes: telegram
#QueriesSchemes: tg
#QueriesSchemes: tgapp
#PlistExtra: <key>LSApplicationQueriesSchemes</key>
#PlistExtra: <array>
#PlistExtra: <string>whatsapp</string>
#PlistExtra: <string>telegram</string>
#PlistExtra: <string>tg</string>
#PlistExtra: <string>tgapp</string>
#PlistExtra: </array>
#End Region
GitHub - iOS URL Schemes
Another GitHub (Use search, it's a mess) - Reference: List of iOS App URL Scheme Names & Paths for Shortcuts
Attention: #QueriesSchemes maximum 50 items, more info:
iOS 9 important changes
iOS 9 includes several features which can break existing apps. Note that these changes will only affect your app after it was compiled with Xcode 7. For now this is only relevant if you are using a local builder. However the hosted builders will also be upgraded to Xcode 7 in the near future...
B4X:
Public Sub GetIMApps() As Map
Dim mapApps As Map
mapApps.Initialize
Try
#IF B4A
Dim pm As PackageManager
Dim packages As List
packages = pm.GetInstalledPackages
For i = 0 To packages.Size - 1
Select Case packages.Get(i)
Case "com.whatsapp", "com.whatsapp.w4b", "org.telegram.messenger"
mapApps.Put(packages.Get(i), pm.GetApplicationLabel(packages.Get(i)))
End Select
Next
#Else If B4I
If Main.App.CanOpenURL("whatsapp://") Then
mapApps.Put("whatsapp", "WhatsApp")
End If
If Main.App.CanOpenURL("telegram://") Then
mapApps.Put("telegram", "Telegram")
End If
#End If
Catch
Log(LastException)
End Try
Return mapApps
End Sub