com.lampa.startapp icon indicating copy to clipboard operation
com.lampa.startapp copied to clipboard

Invalid Intent

Open Smohanapriya opened this issue 6 years ago • 3 comments

Hi I have tried the following code to call the app,

 var sApp = startApp.set({
      "action"      :  "ACTION_SEND",
      "category"    :  "CATEGORY_DEFAULT",
      "package"     :  "PACKAGE NAME",//The packageName of the app I want to open
      "intent"      :  "INTENT ID",//Name of the intent
      "intentstart" :  "startActivityForResult",
      "type"        :  "text/xml"
   }, { /* extras */
        "PID_OPTIONS":"PASS DATA"//Here i want to pass some xml data
   })

   sApp.start(function(result) { /* success */
        console.log("Success"+result);
   }, function(error) { /* fail */
        alert("error :"+error);
   });

I am getting "success callback result as OK", but I am getting toast message in my app as "Invalid intent code 999".

Can anyone help to resolve this issue?

Anyone can explain how to get the intent callback result?????

Smohanapriya avatar May 16 '18 08:05 Smohanapriya

Hi!

Please, update plugin to 6.1.0 and check this code:

var sApp = startApp.set({
    "action"      :  "ACTION_SEND",
    "category"    :  "CATEGORY_DEFAULT",
    "package"     :  "PACKAGE NAME",//The packageName of the app I want to open
    "intent"      :  "INTENT ID",//Name of the intent
     "intentstart" :  "startActivityForResult",
   "type"        :  "text/xml"
}, { /* extras */
    "PID_OPTIONS":"PASS DATA"//Here i want to pass some xml data
}).start(function(result) { /* success */
    console.log("Success"+result);
}, function(error) { /* fail */
    alert("error :"+error);
}, function(result, requestCode, resultCode) {
    console.log(result, requestCode, resultCode);
});

lampaa avatar May 16 '18 13:05 lampaa

Hi @lampaa I have tried the following code to call the app,

var sApp = startApp.set({
    "category": "CATEGORY_APP_MUSIC",
    "intentstart": "startActivity"
}).start(function(result) { /* success */
    console.log("Success" + result);
}, function(error) { /* fail */
    console.log("error :" + error);
}, function(result, requestCode, resultCode) {
    console.log(result, requestCode, resultCode);
});

I'm getting error : error :class android.content.ActivityNotFoundException: No Activity found to handle Intent { cat=[android.intent.category.APP_MUSIC] }

Can anyone help to resolve this issue?

System Information Ionic 1 Node 4.5.0 NPM 2.15.9 Cordova 6.5.0

nawirulfadli avatar May 25 '18 04:05 nawirulfadli

Hi! for start application to play music test this code:

var sApp = startApp.set({
    "action": "android.intent.action.MUSIC_PLAYER",
    "noParse": true
}).

lampaa avatar May 25 '18 07:05 lampaa