This is a migrated thread and some comments may be shown as answers.

Everlive and RequireJS

1 Answer 77 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bruce
Top achievements
Rank 1
Bruce asked on 29 Sep 2013, 10:33 PM
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.});

1 Answer, 1 is accepted

Sort by
0
Ivan Pelovski
Telerik team
answered on 30 Sep 2013, 12:01 PM
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.
Tags
General Discussion
Asked by
Bruce
Top achievements
Rank 1
Answers by
Ivan Pelovski
Telerik team
Share this question
or