rpc.call displayid issue

  • 1
  • Problem
  • Updated 4 years ago
  • Solved
Greetings,

I have tried various ways to call this display id but to no avail. Here are my steps:

gadgets.rpc.register( "rsparam_set_" + id, weather.checkAuth );   
gadgets.rpc.call( "", "rsparam_get", null, id, "displayId" );

x.x.Controller.prototype.checkAuth = function ( name, value ) {    
    var _auth = new RiseVision.Common.Store.Auth();

    if ( name == 'displayId' ) {

        _auth.checkForDisplay( value, product_id, function ( authorized ) {

            if ( authorized ) {
                x.isAuth = true;
            };

        } );
    }

    alert( x.isAuth );    
    
};

I get false all the time when played on a player. I process works fine when i hard code the displayid thus narrowing down to the following:

gadgets.rpc.register( "rsparam_set_" + id, weather.checkAuth );    
gadgets.rpc.call( "", "rsparam_get", null, id, "displayId" );

Do you have any pointers, do's or donts?


Thank you in advance,


Jason
Photo of j Guzman

j Guzman

  • 210 Points 100 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
Jason,

I'll alert developers to this post and they will get back to you asap.

Thanks for the post.
Photo of j Guzman

j Guzman

  • 210 Points 100 badge 2x thumb
That's impressive Blake, you are on top of things, thanks for the quick reply!
Photo of Alex D.

Alex D., Employee

  • 1,038 Points 1k badge 2x thumb
Hi Jason,

Based on your code, alert(x.isAuth); will get executed before the checkForDisplay() callback is called (x.isAuth = true;).

Other than that there's nothing in the code you presented that would indicate why this works with a hardcoded displayId and not with the one returned from rs_param_get.

Maybe you can double check (by adding an alert) what displayId you're receiving in checkAuth?

If all fails, you can send me a Presentation URL with this Widget so I can investigate further.

Thanks.