Issue with Deeplinking

SreeeeSreeee INMember ✭✭✭✭✭

I implement deeplinking to android part of my xamarin forms project. But when I click the url, initially it loads a black page with app name on the top, after a short period only it opens my app. I need to avoid this black screen. Also, the app opens in the same window, no new window is started for my app, if I click the url from whatsapp, the app opens in the whatsapp window.

I need a solution for these 2 problems.

Thanks in advance.

Best Answer

  • SreeeeSreeee IN ✭✭✭✭✭
    edited February 2018 Accepted Answer

    Hi @DeepakSakpal and @Charwaka

    Solve this issue in a tricky way:

    In android manifest set android:name like below:

         android:name=".MainActivity"
    

    And in Mainactivity add Name like below:

    [Activity(Name = "packagename.MainActivity")]
    

    Please note this :)

Answers

  • DeepakSakpalDeepakSakpal USMember ✭✭
    Can you post sample code of yours?
  • CharwakaCharwaka INMember ✭✭✭✭✭

    @Sreeee said:
    I implement deeplinking to android part of my xamarin forms project. But when I click the url, initially it loads a black page with app name on the top, after a short period only it opens my app. I need to avoid this black screen. Also, the app opens in the same window, no new window is started for my app, if I click the url from whatsapp, the app opens in the whatsapp window.

    I need a solution for these 2 problems.

    Thanks in advance.

    Check this once and also try this sample code

    https://developer.xamarin.com/guides/xamarin-forms/platform-features/deep-linking/

  • SreeeeSreeee INMember ✭✭✭✭✭
    edited January 2018

    @DeepakSakpal said:
    Can you post sample code of yours?

    My code in androidmanifest.xml

    <application android:label="Myapp">
        <activity android:icon="@drawable/icon" android:name="Mypackagename.MainActivity" android:label="Myapp">
            <intent-filter>
                <data android:scheme="https" android:host="www.myapp.com"/>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
            </intent-filter>
        </activity>
    </application>
    

    I follow the format of packagename.mainactivity for andriod:name inside of activity tag, inside of application tag, is that correct?

  • SreeeeSreeee INMember ✭✭✭✭✭
    edited February 2018 Accepted Answer

    Hi @DeepakSakpal and @Charwaka

    Solve this issue in a tricky way:

    In android manifest set android:name like below:

         android:name=".MainActivity"
    

    And in Mainactivity add Name like below:

    [Activity(Name = "packagename.MainActivity")]
    

    Please note this :)

  • CharwakaCharwaka INMember ✭✭✭✭✭

    @Sreeee said:
    Hi @DeepakSakpal and @Charwaka

    Solve this issue in a tricky way:

    In android manifest set android:name like below:

         android:name=".MainActivity"
    

    And in Mainactivity add Name like below:

    [Activity(Name = "packagename.MainActivity")]

    Please note this :)

    By default his will be created

  • SreeeeSreeee INMember ✭✭✭✭✭

    Hi @Charwaka

    For me, it is not created default, I added all these in my project.

    I use the following link for implementing the deeplinking. It is very easier than the blog you shared.
    https://riccardo-moschetti.org/2014/10/03/opening-a-mobile-app-from-a-link-the-xamarin-way-url-schemas/

Sign In or Register to comment.