I'm trying to use Firebase dynamic link option and succeeded to create a link that opens the app, but the opening process doesn't look smooth. It looks something like that -
Once I click on the link, it looks like the browser (Chrome) is opening (for a short time)
Then it returns to the screen from which I opened the link (in the case WhatsApp), and displays a white rectangle with a "loading" sign inside it, in the center of the screen.
Open the App.
This is not the case, say, if I try to access another application on my phone via a link (say Spotify or Facebook - in this case, I can see only a black screen until the app opens).
How can I get the same effect as in Spotify (a black screen)?
The part in the MANIFAST that relate to this activity -
<activity android:name=".Activities.WelcomeActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="thisapp.page.link"
android:scheme="https"/>
</intent-filter>
</activity>
What else can help?
Related
What I want to achieve is that if user tap on the link e.g. on Whatsapp:
HTTP://dev.mycompany.com/qr/asd89f7as98df78
This link will open my app supplied with the deep link.
But the issue is this link actually open my app inside the Whatsapp. So when I open the app switcher, it looks like there are two instances of my app opened. How can I fix this?
I suspect this has something to do with the way I configure my intent filter on Android Manifest. But I'm inexperienced with intent-filter. This is the current configuration for my intent filter(s):
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="dev.mycompany.com" />
<data android:scheme="https" />
</intent-filter>
Is there anything I can do to fix the problem? The first intent filter is the default when I create the app. The second one is from copy pasting from solutions I find on stack overflow. But I don't think this is the fully correct solution. I don't want the app to can be opened as popup.
I seem to be doing something wrong with deep linking in my app. I have two activities: a post viewer which views posts on a site, and a profile viewer which views a users profile. Below is my code that I've set up following Google's guide to deep linking.
Profile Activity Manifest Declaration
<activity
android:name=".ui.activity.ProfileActivity"
android:parentActivityName=".ui.activity.MainActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="gab.ai"
android:pathPattern="/..*"
android:scheme="https" />
</intent-filter>
</activity>
Post Viewer Activity Manifest Declaration
<activity
android:name=".ui.activity.PostViewerActivity"
android:parentActivityName=".ui.activity.MainActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="gab.ai"
android:pathPattern="/..*/posts/..*"
android:scheme="https" />
</intent-filter>
</activity>
I've left out the intent handling code because it is redundant. The deep links work properly, except for a weird issue when opening URLs that direct to the post viewer activity.
This works perfectly. Tapping a link such as https://url/.. opens the dialog and lists only one option When selecting the app, it opens the proper activity perfectly.
Here's where it gets weird. When clicking a URL such as https://url/../posts/.. the Android System sees both activity deep links as feasible. My question is how do I get around this? Changing the URL scheme is out, and I'm not fluent enough about deep links to figure out a workaround.
In ProfileActivity android:pathPattern="/..*" equals to /..*/posts/..* because an asterisk ('*') matches a sequence of 0 to many occurrences of the immediately preceding character. Try to use escape character \ as explained in docs
I don't know if it's really understandable.
When i'm clicking on a llink in a mail, I can open this link with my application and that's perfeclty what I want.
<intent-filter>
<data android:scheme="https" android:host="xxx.xxx.com"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
BUT
When i'm opening my application like that, and I check the opened application, I see that my application is "inside" Gmail task, like that
But, when i'm opening the link with Chrome for exemple, Chrome is opening in his own task, like that
How can my application open in her own task and NOT inside Gmail's one ?
you have to set a specific andorid:launchMode to your activity:
android:launchMode="singleTask"
or
android:launchMode="singleInstance"
placed in the declaration of your activity in the AndroidManifest.xml will do it.
take a look also at this article that explain how android handles tasks and activities
If you want to start Google Now on Nexus devices, you swipe-up with a simple gesture from the navbar. I want go replace this feature with my own app. if you swipe the, app-picker comes and asks you which app do you want to start: my app or Google Now. How can I implement this?
I have found an example which runs without root.
Add the following <intent-filter> to the Activity you want launched from the gesture:
<intent-filter>
<action android:name="android.intent.action.ASSIST" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
You will now see an option for your app when you make the swipe now, and will have to select it as the default handler by selecting Always, as shown below.
It's just a matter of setting the correct intent filter:
<intent-filter>
<action android:name="android.intent.action.ASSIST"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
I am trying to set my application what will be a tool to edit pictures, to the menu in the gallery app of the android phone. I know it should go with the intent-filter but I can not get it to work.
<activity android:name=".Compass" android:label="#string/main_compass_tool_button">
<intent-filter android:label= "#string/main_compass_tool_button">
<action android:name="android.intent.action.SHARE"/>
<data android:mimeType="image/*"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
The reason it is not working is because the action should be
android.intent.action.SEND
Not
android.intent.action.SHARE
I've mixed up the two also. SHARE is what you are supposed to show in the interface when sending a SEND intent - there is no SHARE intent.