VivaPayments / mobile-android-cardterminal-interapp-sample

Inter-App communication sample for Viva Wallet Card Terminal Android app
https://developer.vivawallet.com
3 stars 2 forks source link

Demo Android App Integration - No activity found error #4

Open ciprian-stoian opened 7 months ago

ciprian-stoian commented 7 months ago

Hello,

We are in the process of integrating the Viva Wallet app-to-app feature to our POS solution on Android. The app is made with Flutter and following the docs at https://developer.vivawallet.com/apis-for-point-of-sale/card-terminal-apps/android-app/sale/#sale-request we are launching an Intent like this:

AndroidIntent(
  action: "action_view",
  data: Uri.encodeFull("vivapayclient://pay/v1"),
  arguments: {
    "appId": "ro.boogit.boogitposclient",
    "action": "sale",
    "clientTransactionId": $transactionId,
    "amount": $amount,
    "tipAmount": $tipAmount,
    "show_receipt": true,
    "show_transaction_result": true,
    "show_rating": true,
  },
  flags: [
    Flag.FLAG_ACTIVITY_NEW_TASK,
    Flag.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS,
  ],
);

The Demo Viva Wallet app launches but I get the error from the screenshot with no other logs in the console. Could you please help me figure out this error?

Thanks!

Screenshot_20231220-112659

jibinjayachandran commented 5 months ago

Have you resolved this issue ?

ciprian-stoian commented 5 months ago

Have you resolved this issue ?

Haven't got any answer sadly

iwkse commented 5 months ago

Same here, using kotlin, it starts but gets the error in the screenshot. Would be cool to have some feedback.

rafaelaManta commented 5 months ago

You need to change the AndroidManifest.xml (android/app/src/main). Locate the activity tag with name: ".MainActivity" and add the following:

<intent-filter> 
  <action android:name="android.intent.action.VIEW"/> 
   <action android:name="package_name.URLResponseActivity"/>
   <category android:name="android.intent.category.DEFAULT"/>
   <category android:name="android.intent.category.BROWSABLE"/>
   <data android:scheme="scheme"  android:host="result"/>
 </intent-filter>

Change the package_name and scheme with your preferences.

iwkse commented 5 months ago

You need to change the AndroidManifest.xml (android/app/src/main). Locate the activity tag with name: ".MainActivity" and add the following:

<intent-filter> 
  <action android:name="android.intent.action.VIEW"/> 
   <action android:name="package_name.URLResponseActivity"/>
   <category android:name="android.intent.category.DEFAULT"/>
   <category android:name="android.intent.category.BROWSABLE"/>
   <data android:scheme="scheme"  android:host="result"/>
 </intent-filter>

Change the package_name and scheme with your preferences.

Yes, we managed to make it works moving from kotlin to plain java and use the sale request API. Thank you anyway for the reply.