Skip to content

kaushikravikumar/HQDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HQDemo

HQ Demo App, built using PubNub Functions to create realtime live game show experience for players. For full tutorial, click here

Admin App Client App
Admin App Client App

QuickStart

Sign up for PubNub click here:

PubNub Signup

PubNub Functions Setup

  1. Create a new Project.
  2. Go to Key Info and enable Presence, PubNub Functions, and Access Manager.
  3. Create Functions module and within it create 3 functions: getAnswers, submitAnswer, and grantAccess.
  4. Enter code for each function into its respective code editor on PubNub functions page.
  5. Ensure that PubNub Functions module is started and running.

Android App Setup

  1. Go to Key Info and take note of your subscribe key and publish key. You will need to go to the Constants.java class and enter these credentials where it says INSERT_SUBSCRIBE_KEY and INSERT_PUBLISH_KEY respectively. Enter grantAccess PubNub function URL in Constants.java class.

  2. Ensure that you have the following gradle dependencies:

Module Build.gradle

    implementation 'com.android.volley:volley:1.1.0'
    implementation group: 'com.pubnub', name: 'pubnub-gson', version: '4.12.0'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'

Project Build.gradle

    repositories {
        maven { url 'https://jitpack.io' }
        google()
        jcenter()
    }
  1. Ensure that you have the following Android Manifest Permissions:
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Javascript Web App setup

  1. Enter getAnswers PubNub Functions URL into code, where it says ENTER_GET_ANSWERS_PFUNC_URL on the top of index.js file.

  2. Enter Subscribe Key, Publish Key, and Secret Key at the top of the index.js file also.

Congrats! You have successfully set up HQ Demo App and it is ready to run.

About

PubNub Functions powered HQ Demo App

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published