From d03a19a81148e2d72e9db871d45ee6c8a1919256 Mon Sep 17 00:00:00 2001 From: Martin Bektchiev Date: Tue, 27 Sep 2016 18:00:53 +0300 Subject: [PATCH] Use the automatic template substitution mechanism for AppId * Replace placeholder with ${AppId} * Add settings.js to the templateFiles globs array * Update AppID section of README.md * Edit message in `noappidView.html` --- .sample-metadata.json | 4 +++- README.md | 6 +++--- friends-hybrid/common/settings.js | 2 +- .../components/missingSettingsView/noappidView.html | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.sample-metadata.json b/.sample-metadata.json index 4938f18..9ba77f3 100644 --- a/.sample-metadata.json +++ b/.sample-metadata.json @@ -192,5 +192,7 @@ ] } }, - "templateFiles": [] + "templateFiles": [ + "common/settings.js" + ] } diff --git a/README.md b/README.md index 4cede71..3e92d5a 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ The Friends sample app comes fully functional, but to see it in action you must This is a unique string that links the sample mobile app to your Telerik Platform account where all the data is read from/saved. To set it in the app code: 1. Open the `friends-hybrid/common/settings.js` file. -2. Replace `$YOUR_TELERIK_APP_ID$` with the App ID of your Telerik Platform app. +2. Set the value of `app.settings.appId` with the App ID of your Telerik Platform app. ## (Optional) Enable Telerik Analytics @@ -83,7 +83,7 @@ If you want to collect analytics data from your Friends sample app, you need to * **Automatic app feature tracking** > * Analytics only works on physical devices or emulators. It does not work in the AppBuilder simulator. -> * If you are working in the Universal, Windows, or Visual Studio AppBuilder client, you need to restart it for the setting to be reflected. +> * If you are working in the Universal, Windows, or Visual Studio AppBuilder client, you need to restart it for the setting to be reflected. ## (Optional) Facebook App ID @@ -94,7 +94,7 @@ To demonstrate social login, we have preinitialized the sample to use a purpose- 4. Ensure that the **Facebook** box is checked. > Note that if you intend to use the sample app code for a production app you need to set up your own Facebook application and adjust the Facebook app ID as follows: - + 1. In the Telerik Platform portal, go to your app. 2. Click the **Code** tab. 3. In the **Project Navigator**, double-click **Plugins**. diff --git a/friends-hybrid/common/settings.js b/friends-hybrid/common/settings.js index 5b05626..ac4348a 100644 --- a/friends-hybrid/common/settings.js +++ b/friends-hybrid/common/settings.js @@ -2,7 +2,7 @@ (function () { app.settings = { - appId: '$YOUR_TELERIK_APP_ID$', + appId: '${AppId}', scheme: 'http', // possible values: http, https social: { facebook: { diff --git a/friends-hybrid/components/missingSettingsView/noappidView.html b/friends-hybrid/components/missingSettingsView/noappidView.html index f976012..a32130e 100644 --- a/friends-hybrid/components/missingSettingsView/noappidView.html +++ b/friends-hybrid/components/missingSettingsView/noappidView.html @@ -5,5 +5,5 @@

App ID links the sample mobile app to a project in Telerik Platform.

-

To set the App ID open the settings.js file and replace TELERIK_APP_ID with the App ID of your 'Friends' project.

- \ No newline at end of file +

To set the App ID open the settings.js file and replace app.settings.appId with the App ID of your 'Friends' project.

+