WordPress LMS for Web and mobile Forums Ionic App Support Make the user login in browser when he login in app

Make the user login in browser when he login in app

Tagged: , , ,

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #41214

    Scott Lang
    Keymaster

    Hi,

    Can you share your admin credential in private reply. Also which page you are embedding your iframe share with us. We need to configure the app at our end check the possibilities.

    Also, you are using a third party plugin let us know ??

    #41256

    Aminericher
    Participant
    This reply has been marked as private.
    #41265

    Scott Lang
    Keymaster

    Hi,

    App and web login work differently. In-app work with API which gives token after login but in site works with cookies.

    Wplms do not support third-party plugin for content restriction but we have added WordPress filter [like:http://prntscr.com/qde5z4 ]. You can use it to filter the data before sending it to the app.

    #41267

    Aminericher
    Participant

    Hi, in fact I don’t need a support on a third party plugin. When I embed the unit itself within the app using the iframe, it gives the “direct access to units not allowed” error. This is due to the login working differently in app and web. I don’t know how this filter could be used to make logged in app logged in web too. Any further help?

    #41274

    Scott Lang
    Keymaster

    Hi,

    We understand the issue you wanted to disable the unit open in-app browser refer to this setting: http://prntscr.com/qdfbku

    Direct unit access means a student can not directly go to the unit page he has to follow the path from the course.

    #41275

    Aminericher
    Participant

    I want to embed an iframed webview from the unit, because the unit contain a private vimeo video, and private vimeo videos could not be played in the app because they are restricted to my domain. You may be know about this issue.
    Now when I use an iframe from the unit (and the unit is not free and its direct access for the visitors is disabled in wplms parameters), the logged in user will see the ” direct access to units not allowed” error inside the iframe, since the user is not detected as logged in in the webbrowser, though a visitor, and only logged in app.
    Do you mean that I should set both parameters in image to false to make this work?
    I hope you get my issue.

    #41308

    Scott Lang
    Keymaster

    If the videos are accessible publicly thus they will access within the unit.

    Add this code to your customizer plugin this will enable direct access to unit from app in-app browser

    add_filter(‘wplms_direct_access_tounit’,’enable_access_tostudents’,999,2);
    function enable_access_tostudents($flag,$post){ if(!empty($_GET) && !empty($_GET[‘access_token’])){
    $token = urldecode ($_GET[‘access_token’]);
    $course_id = $_GET[‘id’]; global $wpdb;
    $user_id = $wpdb->get_var(“SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = ‘$token'”); if(!empty($user_id) && is_numeric($user_id)){ $check = wplms_user_course_active_check($user_id,$course_id);
    if($check){
    return 0;
    }
    } }
    return $flag;
    }

    After that go to the unit URL from app unit button click.

    #41314

    Aminericher
    Participant

    Hi Scott, I don’t need the direct access via clicking on the button, though through the iframe embedded within the unit, without having to click on any button. This iframe has a unit content and the unit itself is in setting not accessible to visitors, but only to students.
    I have opted to this method to help users play my private vimeo videos. These videos are restricted to my domain and will be not read in a mobile app, despite the app is displaying the website. Thats why I am using an webview from my domain where the video is embeded, and I display it as an iframe in the unit in the app in order to be displayed in the app as a simple iframed webview.
    The logged in user in app is still a visitor in the iframe because it displays a webview from the unit, thats why the content of the unit will still be denied and the error message will be instead displayed.
    Can you help me to find a workaround so that the logged in app user can see the iframe of the unit embeded in the unit?

    #41371

    Scott Lang
    Keymaster

    If your videos are restricted to your site thus we can not make any access for video from the app or site, because it is restricted from somewhere else. Not from your domain.

    But the given code will disable the direct access unit page so that the user can go to the unit page view the content after login.

    #41389

    Aminericher
    Participant

    Hi Scott, we are turning around the main subject without resolving it. Whatever I put in the unit, either a private video or a youtube video or just a simple text, the access to the iframe will be denied, because the login in ionic app is not detected in webbrowser. Can you help me with this exact issue? Can I ask this as a customization: when the user log in app, he would be automatically logged in web. Please answer my question

    #41449

    Scott Lang
    Keymaster

    Because login in-app is different from the web so that login in app not detected and content restricted.

    The issue is caused by third party plugin Please disable.

    or We can have to take a look if we do something, We need that plugin file to check the code for restriction handling from our side in the app. Please share it in a private reply.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.