android - AAR Record in NFC: Where's The Payload? -
according this answer, , validated testing, when use android beam push on nfc message containing aar record, receiving device start main/launcher activity app specified in aar.
that main/launcher intent not contain nfcadapter.extra_ndef_messages extra. hence, data went through trouble beam on appears lost if use aar.
is there way nfc messages triggered app started in scenario?
and if answer "no", use case of aar? can see might helpful when desired app not exist on receiving device (brings play store), once app installed, aar foils attempt deliver data 1 device other, kinda point behind nfc.
thanks!
at risk of answering own question, 1 recipe getting work (apparently) is:
have beam sender use nfc message 2 nfc records, first containing unique mime type, second being aar
have beam recipient have
<intent-filter>on activity responds first nfc record, such via:<intent-filter> <action android:name="android.nfc.action.ndef_discovered"/> <category android:name="android.intent.category.default"/> <data android:mimetype="application/vnd.commonsware.webbeam"/> </intent-filter>
if app exists, ndef_discovered intent used, , recipient can pick nfc message , pull out data initial record. if app not exist, aar kick in, bringing play store (whether app distributed through play store or not).
this recipe shown in android beam example on developer site.
Comments
Post a Comment