Forum Xamarin.Android

Launch my app from Barcode Scanner - QRCODE

AlonAvivAlonAviv USMember ✭✭
edited June 2015 in Xamarin.Android

Hi, I assigned to a QRCode a text/url (tried them both) - myApp://myApp.example.com
I added to my app this code:
[IntentFilter (new[]{Intent.ActionView},Categories=new[]{Intent.CategoryDefault,Intent.CategoryBrowsable,Intent.CategoryLauncher,Intent.CategorySampleCode},Icon="@drawable/icon",DataScheme="myApp",DataHost="myApp.example.com",DataPath="/")]
and in the manifest.xml I added:
<activity android:name="myApp.activity"> <intent-filter android:icon="@drawable/icon"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.SAMPLE_CODE" /> <data android:scheme="myApp" android:host="myApp.example.com" android:path="/" /> </intent-filter> </activity>
I scanned the generated QRcode but my app doest not open.
Help please.

Answers

  • marlonfalmarlonfal Member ✭✭

    I know this in al old question.

    But what worked for me was this.

    I added this in the MainActivity.cs

    [IntentFilter(new[] { Intent.ActionView }, Categories = new[] { Intent.CategoryDefault , Intent.CategoryBrowsable }, DataScheme = "AppName")]

    And created the code with this.

    AppName://extraText

Sign In or Register to comment.