Skip to content

playportal-studio/AirTime

Repository files navigation

App Overview


AirTime is an app that brings the playPORTAL SDK and the Apple Watch together. It uses the on-board Apple Watch accelerometer to complete simple gesture recognition to count pogo stick jumps and airtime. Go outside, get your pogo stick and start jumping. Feel free to modify this code, and create your own playPORTAL Apple Watch app.

Read the full blog about this demo app posted here.

SDK Features Used

Getting Started (playPORTAL setup)

  • Step 1: Create playPORTAL Studio Account

    • Navigate to playPORTAL Studio
    • Click on Sign Up For FREE Account
    • After creating your account, email us at accounts@playportal.io to introduce yourself and your project and we will consider you for early access.
  • Step 2: Register your App with playPORTAL

    • After confirmation, log in to the playPORTAL Studio
    • In the left navigation bar click on the Apps tab.
    • In the Apps panel, click on the "+ Add App" button.
    • Add an icon (example image here).
    • Enter a unique app name (you cannot use the name AirTime because it is already in use).
    • Enter a description for your app.
    • For "Environment" leave "Sandbox" selected.
    • Click "Add App"

  • Step 3: Setup your permission scopes.

    • Add permission scopes for each of the SDK features used in the app. Reference the image below.

  • Step 4: Generate your Client ID and Client Secret

    • Tap "Client IDs & Secrets"
    • Tap "Generate Client ID"
    • The values generated will be used later.
    • CAUTION: Keep your Client ID & Secret private! Do not commit your credentials!
  • Step 5: Clone the repository

    • Open teminal and clone repository to Desktop
    cd Desktop
    git clone https://github.com/playportal-studio/AirTime.git
    
  • Step 6: Install Cocopods

    • To install
    sudo gem install cocoapods -v 1.6.0.beta.1
    
    • After cocoapods is installed, follow these steps
    cd AirTime
    pod install
    
  • Step 7: Ensure AirTime Compiles

    • Open up the AirTime.xcworkspace file
    • Select a simulator or device that runs an iPhone and Apple Watch together
    • Press the play button to run AirTime
  • Step 8: Link playPORTAL Studio with AirTime

  • Step 8.1: Insert Keys In An App File To Enable User Login

    • The Client ID, & Secrets tied to your application NEED to be hidden
    • Create a .gitignore file (if there isn't an existing one):
     cd AirTime
     touch .gitignore
    
    • Create a Keys.swift file inside your project directory
    • Copy your Client ID and your Client Secret from playPORTAL Studio
    • Define your keys inside the Keys.swift using the format below
        let cid = "CLIENT ID GOES HERE"
       	 let cse = "CLIENT SECRET GOES HERE"
        let redirectURI = "REDIRECT URL GOES HERE"
                let env = "SANDBOX"
      
  • Step 8.2:Open up the project in a different IDE or text editor

    • To edit your .gitignore open the project in either Atom or VSCode
    • Add the filename Keys.swift to the .gitignore
    • Now that your keys are in a file, return to playPORTAL Studio
    • Create a Redirect URL using the name of your Studio app
       appname://redirect
      
  • Step 8.3:SSO Integration in XCode

    • Open XCode
    • Navigate to your app level settings and click on the info tab.
    • Add a new URL under the URL types section.
    • Input your app name from Step 2 into the Identifier and URL Schemes.
  • Step 8.4: Create Sandbox Users For App

    • Go back to playPORTAL Studio
    • Click on Sandbox
    • Generate a few users Tip: You can create kids by creating a Parent and adding a Kid
  • Step 9: Develop!

    • If you made it this far, great you are ready!!!
    • Within XCode, build the App
    • Use username and PW from playPORTAL Studio Step 8.4 to login
    • Good luck and have fun developing
  • Got Stuck? If you did on any of the steps listed here are some links to help!

    • Here is another cocoapods installation directions link
    • Read this to get a refresher on Git commands