Jump to content
pconkie

Open an app

Recommended Posts

Can anyone stop me from wasting any more time on this? @adamw Please!

I need to open an app from a html widget (because I need to send the app an assignment uuid)

I have code that does this from inside a frogcode widget, but it doesn't work in a html widget :( 

I was getting: error trigger is not a function. Implying this.trigger wasn't the way to go.

I got a little closer by using $('div.os_core:first') to trigger from, but still got an error about an undefined name.

var c = $('div.os_core:first');
var appID = "0597421320048F43D12ECF7C62B12F01382427CCB9FE4A12";

c.trigger('os.internal.launchapp', {
  name: appID,
  assignment_uuid: "any assignment uuid",
  appModel: new Com.Frog.Model({
    'uuid' : appID,
    'role_name': Object.values(_Roles.serialize()).filter(function(role) {
      return /app\.frogplay$/gim.test(role);
    })[0],
    'extended_data' : {
      'from_package' : true
    }
  })
});   

Here is my code - you can see that i'm sending option data (assignment_uuid) and using my frogplay role to authorise (I can't figure out the roles but i'm sure this works as it worked in frogcode).

Any ideas?

Thanks

Paul

 

Share this post


Link to post
Share on other sites
19 hours ago, pconkie said:

Can anyone stop me from wasting any more time on this? @adamw Please!

I need to open an app from a html widget (because I need to send the app an assignment uuid)

I have code that does this from inside a frogcode widget, but it doesn't work in a html widget :( 

I was getting: error trigger is not a function. Implying this.trigger wasn't the way to go.

I got a little closer by using $('div.os_core:first') to trigger from, but still got an error about an undefined name.


var c = $('div.os_core:first');
var appID = "0597421320048F43D12ECF7C62B12F01382427CCB9FE4A12";

c.trigger('os.internal.launchapp', {
  name: appID,
  assignment_uuid: "any assignment uuid",
  appModel: new Com.Frog.Model({
    'uuid' : appID,
    'role_name': Object.values(_Roles.serialize()).filter(function(role) {
      return /app\.frogplay$/gim.test(role);
    })[0],
    'extended_data' : {
      'from_package' : true
    }
  })
});   

Here is my code - you can see that i'm sending option data (assignment_uuid) and using my frogplay role to authorise (I can't figure out the roles but i'm sure this works as it worked in frogcode).

Any ideas?

Thanks

Paul

 

Can't help....  but am always keen to see what Conkies cooking up.... 😝

Share this post


Link to post
Share on other sites
On 26/04/2020 at 01:05, pconkie said:

Can anyone stop me from wasting any more time on this? @adamw Please!

I need to open an app from a html widget (because I need to send the app an assignment uuid)

I have code that does this from inside a frogcode widget, but it doesn't work in a html widget :( 

I was getting: error trigger is not a function. Implying this.trigger wasn't the way to go.

I got a little closer by using $('div.os_core:first') to trigger from, but still got an error about an undefined name.


var c = $('div.os_core:first');
var appID = "0597421320048F43D12ECF7C62B12F01382427CCB9FE4A12";

c.trigger('os.internal.launchapp', {
  name: appID,
  assignment_uuid: "any assignment uuid",
  appModel: new Com.Frog.Model({
    'uuid' : appID,
    'role_name': Object.values(_Roles.serialize()).filter(function(role) {
      return /app\.frogplay$/gim.test(role);
    })[0],
    'extended_data' : {
      'from_package' : true
    }
  })
});   

Here is my code - you can see that i'm sending option data (assignment_uuid) and using my frogplay role to authorise (I can't figure out the roles but i'm sure this works as it worked in frogcode).

Any ideas?

Thanks

Paul

 

Try:

FrogOS.openApp(
    'yourappnamehere',
    {
      assignment_uuid: "any assignment uuid",
    }
);

You have to open it with the app name, not the uuid (I think)

  • Thanks 1

Share this post


Link to post
Share on other sites
25 minutes ago, adamw said:

Try:


FrogOS.openApp(
    'yourappnamehere',
    {
      assignment_uuid: "any assignment uuid",
    }
);

You have to open it with the app name, not the uuid (I think)

No, nothing.

Could my app not be called what i think it is called?

<script>
    console.log("running?")
    FrogOS.openApp(
        'app.externalapps.42134a12.activityreview',
        {
            assignment_uuid: "52A6047720003DD21F405F682109D30B81F312EC00EAA941",
        }
    );
    FrogOS.openApp(
        'activityreview',
        {
            assignment_uuid: "52A6047720003DD21F405F682109D30B81F312EC00EAA941",
        }
    );
    FrogOS.openApp(
        'Activity Review',
        {
            assignment_uuid: "52A6047720003DD21F405F682109D30B81F312EC00EAA941",
        }
    );
</script>

It does something......I have tried the above (the last one is what it is actually called in frogcode). First one is what it is called in groups and policies.

But no app.  Looks like it can not find the correct url?

Capture.PNG.73c73ffd47ef0f35f2056d5d7df482f7.PNG

 

Share this post


Link to post
Share on other sites

Hmm, I would expect the app name to be the same as it appears in your manifest - so probably something like the second example you showed.

Is the app deployed? Also, I'll need to check that we can open Frogcode apps in that way, I never thought about that before!

Share this post


Link to post
Share on other sites

I put your question to the experts here at Frog and this is what they have suggested should work!

c.trigger('os.internal.launchapp', {
    data: {
        name: appID,
        appModel: new Com.Frog.Model({
            'uuid' : appID,
            'role_name': Object.values(_Roles.serialize()).filter(function(role) {
              return /app\.frogplay$/gim.test(role);
            })[0],
            'extended_data' : {
              'from_package' : true
            }
          })
    }
});

 

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, adamw said:

I put your question to the experts here at Frog and this is what they have suggested should work!


c.trigger('os.internal.launchapp', {
    data: {
        name: appID,
        appModel: new Com.Frog.Model({
            'uuid' : appID,
            'role_name': Object.values(_Roles.serialize()).filter(function(role) {
              return /app\.frogplay$/gim.test(role);
            })[0],
            'extended_data' : {
              'from_package' : true
            }
          })
    }
});

 

But that looks identical to what i posted!!

However - it does work. Thanks! 

BTW I do consider you an expert.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...