BuzzScreen JS Extension SDK Usage

Introduction

Please refer to the sample included in the SDK before applying to your app. - Github Link

Extension JS SDK Workflow

Please discuss with your account manager before proceeding.

Index


Getting started

1. Sign in and point accumulation request flow

What the publisher needs to do is marked in blue in the table below.

1

When a user tries to login by clicking a sign-in button on the BuzzScreen Android client, publisher's web frontend opens via WebView and is shown to the user.

2

The user attempts to sign in from the web frontend on the WebView.

3

The publisher's web frontend receives the user information and passes it to the publisher's server.

4

When the user is successfully signed-in, publisher's server forwards the session information to the web frontend.

5

The publisher's web frontend confirms that the user has signed in and calls the BuzzScreen Extension JS SDK function to pass user information.

6

BuzzScreen Extension JS SDK passes user information to Android client through Javascript Interface provided by Android. This information is then passed to the BuzzScreen server, which allows the Android client to serve contents and ads.

7

The Android client uses the BuzzScreen SDK to communicate with the BuzzScreen server upon user action such as landing or unlock.

8

The BuzzScreen server passes the userId and point information to the publisher's server to indicate how many points the particular user should receive.

9

The publisher's server receives the above information and gives points to the user.

2. Publisher's task

What the publisher needs to do is marked in blue in the diagram above.

Content

Detail

Content

Detail

1

Sign-in integration

If a user is successfully signed in from the publisher's website, this sdk should be used to pass user information to BuzzScreen SDK. This is explained in detail in the rest of this guide.

2

Postback integration

Publisher's server needs to be integrated with Buzzscreen server in order to give points to users for valid user action. Please refer to .

 

Basic Usage - Sign-in integration

For the sign-in integration, the publisher should inform Buzzvil of the sign-in verification URL. Also SDK integration is required on result pages for both users who has signed in successfully and who hasn't.

1. Sign-in verification URL

 

Content

Detail

Content

Detail

Sign-in verification URL

URL required to check whether the user has signed in or not

  • Signed-in users and non-signed-in users must see different result pages at the same URL depending on their sign-in status.

  • Different functions of this SDK should be called on each page to distinguish whether the user has signed in or not.

A. For user who has signed in

  • Show result page

  • Notify "signed in" to BuzzScreen

B. For user who has not signed in

  • Show login page

  • Notify "not signed in" to BuzzScreen

For example, suppose that https://www.buzzvil.com/profile is a sign-in verification URL.

  • When a user who already signed in accesses this address, a page with the account information of the user will be shown (indicated as personal page in the above diagram). On this page, SDK should be loaded and Buzzscreen.notifySignedIn()should be called in order to pass the user information to BuzzScreen.

  • On the other hand, when a user who hasn't signed in accesses this address, a login page asking for Id and password is shown (indicated as login page). On this page, SDK should be loaded and Buzzscreen.notifyNotSignedIn()should be called in order to notify BuzzScreen that user is not signed in.

 

2. How to integrate JS SDK

1) Insert SDK

Insert this SDK on each of the two pages accessible by the "Sign-in verification URL".

<script src="buzzscreen-extension-0.0.2.js"></script>

2) Notify "signed in"

On personal page from the above diagram (the page shown when the user has signed in), call the following JavaScript code to pass the user information (user ID, year of birth, gender and extra data) and to notify BuzzScreen.

<script> BuzzScreen.notifySignedIn('userId', 1990, BuzzScreen.GENDER_MALE, '{"key1":"value1","key2":"value2"}'); BuzzScreen.notifySignedIn('userId', 1990, BuzzScreen.GENDER_FEMALE, '{"key1":"value1","key2":"value2"}'); </script>
  • The type of each argument is string, number, string, string in that order.

    • Please take extra caution not to use wrong argument types.

    • If the arguments are set incorrectly, error logs are left in the console window.

In case where users' birthYear, gender and extra information is not available, the following code can be called instead.

<script> BuzzScreen.notifySignedIn('userId'); </script>

3) Notify "not signed in"

On login page (the page shwon when not-signed-in user access the verification url), call the following JavaScript code:



Advanced Usage

Functions for SDK configuration convenience

Content

Method

Detail

Content

Method

Detail

Check if the page is loaded in BuzzScreen Webview

The API returns true if a page loaded from BuzzScreen Webview, or false.

See detailed logs

If you set the verbose option to true, you can also view logs at the console.info level.