A
A
AndreyRafalsky1322019-07-01 10:59:39
Android
AndreyRafalsky132, 2019-07-01 10:59:39

How to open a specific application activity when the user clicks on a link?

I implement the functionality "Forgot your password?" using Firebase Auth. A link is sent to the mail, when clicked, a primitive form opens with one field for entering a new password. I want to open a specific activity in the application, where the user must enter a password and then confirm it. How to implement such functionality? I read that this is implemented using dynamic links, but I did not find specific examples. Thanks in advance for your help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Alexandrovich, 2019-07-01
@AndreyRafalsky132

I worked about half a year ago with this technology and there were some problems with it, but I think that they should have been fixed. here are articles
https://medium.com/mindorks/working-with-firebase-...
https://medium.com/@1991chester/deep-links-fc993c7242af
https://firebase.apptractor.ru/firebase-na -android...
and of course https://firebase.google.com/docs/dynamic-links/and...
you can try this project https://github.com/firebase/quickstart-android/tre...

A
AndreyRafalsky132, 2019-07-01
@AndreyRafalsky132

Thanks for the help. Implemented opening an activity when a user clicks on a link. Now another problem has arisen. I need to get parameters from this link. To do this, I need to get it first. I do it like this:

FirebaseDynamicLinks.getInstance()
                .getDynamicLink(getIntent())
                .addOnSuccessListener(pendingDynamicLinkData -> {
                    if (pendingDynamicLinkData != null){
                        String link = pendingDynamicLinkData.getLink().getUserInfo();
                        Log.d("MyPlanner", link);
                    }
                })
                .addOnFailureListener(exception -> {
                    Log.d("MyPlanner", exception.getMessage());
                });

The problem is that pendingDynamicLinkData is null. What is the reason I do not understand.
Here is my manifest:
<activity android:name=".view.activity.SaveNewPasswordActivity">
            <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="coditrafalsky.page.link"
                    android:scheme="https"
                    android:path="/reset"/>

            </intent-filter>
        </activity>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question