PlayVisit iOS SDK

Add your PlayVisit experiences into your iOS mobile apps

Install the PlayVisit iOS SDK to integrate your experiences created with PlayVisit Studio into your existing iOS mobile app.

Select a method to install the SDK:

Download and unzip the latest version of our SDK

Embed the framework

Drag PlayVisit.framework into your project’sEmbedded Binaries in the project editor. On the sheet that appears, make sure Copy items if needed option s checked, then click Finish.

Set permissions for internet and location access

To give your users a brief explanation of how the app will load the data from internet and use their location data, add the following keys to the Info.plist file.

NSLocationWhenInUseUsageDescription with the description:

“Shows your location on the map and allows you to enjoy the experiences”

NSAllowsArbitraryLoads with the value “true”.

Showing a PlayVisit experience

Add it as a View inserting the following code into your ViewController

import PlayVisit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.view = PVWebView(token: “your_token_here”)
}
}

Copy your experience access token and paste it in the PVWebView instantiation

Add it as a ViewController

func showExperience() {
let viewController = PVViewController()
viewController.PVToken = "your_token_here"
self.present(viewController, animated: true, completion: nil)
}

DONE!

Install the PlayVisit SDK for iOS with CocoaPods

Add the following code to your Podfile.


target 'TargetNameForYourApp' do
pod 'PlayVisit', '~> 1.0.0'
end

Then install the Pod by running the following command in Terminal.

pod install

Finally, open the resulting xcworkspace file in Xcode.

Set permissions for internet and location access

To give your users a brief explanation of how the app will load the data from internet and use their location data, add the following keys to the Info.plist file.

NSLocationWhenInUseUsageDescription with the description:

“Shows your location on the map and allows you to enjoy the experiences”

NSAllowsArbitraryLoads with the value “true”.

Showing a PlayVisit experience

Add it as a View inserting the following code into your ViewController

import PlayVisit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.view = PVWebView(token: “your_token_here”)
}
}

Copy your experience access token and paste it in the PVWebView instantiation

Add it as a ViewController

func showExperience() {
let viewController = PVViewController()
viewController.PVToken = "your_token_here"
self.present(viewController, animated: true, completion: nil)
}

DONE!