Everlive and RequireJS

2 posts, 0 answers
  1. Bruce
    Bruce avatar
    38 posts
    Member since:
    Oct 2009

    Posted 29 Sep 2013 Link to this post

    All,

    I am primarily a back-end dev, but I am slowly starting to understand how the MVVM approach is going to be a benefit. I have seen numerous examples and blog posts about using KendoUI with RequireJS, and even some that include everlive, but in none of the examples have I found where to set the Everlive API Key. If anyone could provide me with an example or guidance, I'd appreciate it. Below is what I have so far...

    Thanks,
    B

    main.js
    01.require.config({
    02.    paths: {
    03.        jQuery: "kendo/js/jquery.min",
    04.        kendo: "kendo/js/kendo.mobile.min",
    05.        everlive: "lib/everlive.all.min"
    06.    },
    07.    shim: {
    08.        jQuery: {
    09.            exports: "jQuery"
    10.        },
    11.        kendo: {
    12.            deps: ["jQuery"],
    13.            exports: "kendo"
    14.        },
    15.        everlive: {
    16.            deps: ["jQuery"],
    17.            exports: "everlive"
    18.        }
    19.         
    20.    }
    21.});
    22. 
    23.var app;
    24.var el;
    25.require(["app/app"], function (application) { 
    26.    app = application;
    27.    app.init();
    28.});
     
    app.js

    01.define(
    02.    [
    03.        "jQuery",
    04.        "kendo",
    05.        "everlive",
    06.        "app/views/defaultView",
    07.        "app/views/loginView",
    08.        "app/views/alertsView"
    09.         
    10.    ],
    11.    function ($, kendo, everlive, defaultView, loginView, alertsView) {
    12.     
    13.        var _kendoApplication;
    14.      
    15.    return {
    16.        init: function () {
    17.            _kendoApplication = new kendo.mobile.Application(document.body, { transition: "slide" });
    18.            el = new everlive("........");
    19.        },
    20.        views: {
    21.            defaultView: defaultView,
    22.            loginView: loginView,
    23.            alertsView: alertsView
    24.        },
    25.        navigate: function(view){
    26.            _kendoApplication.navigate(view);
    27.        }
    28.         
    29.    }
    30.});
  2. Ivan Pelovski
    Admin
    Ivan Pelovski avatar
    16 posts

    Posted 30 Sep 2013 Link to this post

    Hello,

    You almost made it - when initializing an Everlive SDK instance you should pass your API Key:
    var el = new everlive("your-api-key");
    You have probably already seen these posts Using Icenium Everlive With RequireJS and Using LocalStorage And Kendo UI's Observable To Cache Icenium Everlive Access Tokens. You can also check the Everlive hybrid sample and this line specifically.
    If you have more questions, please let us know - we'll be happy to answer them.

    Regards,
    Ivan Pelovski
    Telerik
    You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
Back to Top