Andre Souza Member Licensed User Dec 23, 2015 #1 My app works with a part with a specific url . As I do so that when the user clicks the URL , my app appears on the preference list . And as I do to treat this amount received ?
My app works with a part with a specific url . As I do so that when the user clicks the URL , my app appears on the preference list . And as I do to treat this amount received ?
Erel B4X founder Staff member Licensed User Longtime User Dec 23, 2015 #2 You need to add an intent filter that will intercept the relevant intent. Note that you cannot intercept a specific http url. Once the intent is intercepted then your app will start and you can get the intent with Activity.GetStartingIntent. For example: https://www.b4x.com/android/forum/threads/reading-intent-filters-extra.43719/#content Upvote 0
You need to add an intent filter that will intercept the relevant intent. Note that you cannot intercept a specific http url. Once the intent is intercepted then your app will start and you can get the intent with Activity.GetStartingIntent. For example: https://www.b4x.com/android/forum/threads/reading-intent-filters-extra.43719/#content
Andre Souza Member Licensed User Dec 24, 2015 #3 Hello Use code Manifest B4X: AddActivityText(Main, <intent-filter> <action android:name="android.intent.action.VIEW"></action> <category android:name="android.intent.category.DEFAULT"></category> <category android:name="android.intent.category.BROWSABLE"></category> <data android:host="app.receitassupreme.com" android:scheme="http"></data> </intent-filter>) Code: B4X: Dim in As JavaObject = Activity.GetStartingIntent Log(in.RunMethod("getParcelableExtra", Array("android.intent.extra.STREAM")) The value only null. Where is the mistake ? Upvote 0
Hello Use code Manifest B4X: AddActivityText(Main, <intent-filter> <action android:name="android.intent.action.VIEW"></action> <category android:name="android.intent.category.DEFAULT"></category> <category android:name="android.intent.category.BROWSABLE"></category> <data android:host="app.receitassupreme.com" android:scheme="http"></data> </intent-filter>) Code: B4X: Dim in As JavaObject = Activity.GetStartingIntent Log(in.RunMethod("getParcelableExtra", Array("android.intent.extra.STREAM")) The value only null. Where is the mistake ?
Erel B4X founder Staff member Licensed User Longtime User Dec 25, 2015 #4 Where do you expect the stream to come from? Upvote 0
Andre Souza Member Licensed User Dec 25, 2015 #5 The information will come from links that can be clicked by app. Example: Facebook , WhatApp , etc. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Dec 27, 2015 #6 Your current intent filter intercepts clicks on links. I don't see any reason for a stream to be included in the intent. Upvote 0
Your current intent filter intercepts clicks on links. I don't see any reason for a stream to be included in the intent.
Andre Souza Member Licensed User Dec 27, 2015 #7 How do you get the clicked link ? I found this article, how do I convert to B4A ? http://androblip.huiges.nl/2010/05/19/opening-urls-with-your-application/ Last edited: Dec 27, 2015 Upvote 0
How do you get the clicked link ? I found this article, how do I convert to B4A ? http://androblip.huiges.nl/2010/05/19/opening-urls-with-your-application/
Andre Souza Member Licensed User Dec 27, 2015 #8 This code B4X: Dim Intent1 As Intent Intent1 = Activity.GetStartingIntent Log(Intent1) Content Intent = (Intent) Intent { act=android.intent.action.VIEW dat=http://app.receitassupreme.com/receita/39/compartilhado=true flg=0x3000000 cmp=gh.receitassupreme.com.br/.main (has extras) } How get only URL? Upvote 0
This code B4X: Dim Intent1 As Intent Intent1 = Activity.GetStartingIntent Log(Intent1) Content Intent = (Intent) Intent { act=android.intent.action.VIEW dat=http://app.receitassupreme.com/receita/39/compartilhado=true flg=0x3000000 cmp=gh.receitassupreme.com.br/.main (has extras) } How get only URL?
Andre Souza Member Licensed User Dec 28, 2015 #10 The solution work B4X: Dim urlAppInt As Intent urlAppInt = Activity.GetStartingIntent If urlAppInt.ExtrasToString <> "no extras" Then Log(urlAppInt.GetData) End If Upvote 0
The solution work B4X: Dim urlAppInt As Intent urlAppInt = Activity.GetStartingIntent If urlAppInt.ExtrasToString <> "no extras" Then Log(urlAppInt.GetData) End If