Step 3: Entry Point Configuration
We have multiple entry point options from where we can launch GluedIn SDK and GluedIn will behave differently will all of these different entry points.
1. Launch Gluedin Dashboard as a Guest user on Button click:
call GluedIn Root tab view controller and initiate the navigation flow which is best fit for your application. We show sample code below:
@IBAction func launchGluedinTabAsGuest(_ sender: Any) {
GluedIn.shared.initSdk {
let gluedinTab:UITabBarController = GluedIn.shared.rootTabController() ?? UITabBarController()
self.navigationController?.pushViewController(gluedinTab, animated: true)
} failure: { error, code in
print(error)
}
}
2. Launch GluedIn as a authenticated user:
call to register the user method with multiple parameter and call the root controller once you get the call back from register user method. We show the sample code below:
@IBAction func registerUserAndlaunchGluedin(_ sender: Any) {
GluedIn.shared.initSdk {
GluedIn.shared.quickLaunch(email: "amitch184@gmail.com",
password: "123456789",
firebaseToken: "",
deviceId: "1234",
deviceType: "ios",
fullName: "amit",
autoCreate: true,
termConditionAccepted: true) { [weak self] vw in
guard let weakSelf = self else { return }
weakSelf.navigationController?.pushViewController(vw ?? UIViewController(), animated: true)
} failure: { err,arg in
print(err)
print(arg)
}
} failure: { err,arg in
print(err)
print(arg)
}
}
3. Launch GluedIn from Deeplink: follow the below steps,
Register with firebase and create an app for iOS app (Add Firebase to your Apple project | Firebase for Apple platforms ).
Add an associated domain, received from firebase console, under the associated domain in the "singing and capabilities" section. Refer below image as highlighted in red.
Below are few CTA callbacks from the player.
func didSelectUnlike(videoAsset: FeedModel?) {}
func didSelectShoppableProduct(feedModel: FeedModel?,
shoppableProduct: ShoppableProduct?) {}
func didSelectProfile(feedModel: FeedModel?,
profileId: String,
navigationController: UINavigationController) {}
func didSelectHashtag(feedModel: FeedModel?,
hashtagName: String,
hashtagId: String,
navigationController: UINavigationController) {}
func didSelectChallenge(feedModel: FeedModel?,
challengeName: String,
challengeId: String,
navigationController: UINavigationController) {}
func didSelectShare(feedModel: FeedModel?,
shareType: ShareType,
navigationController: UINavigationController?,
completion: completionHandler?) -> () {}
func didSelectBack(videoAsset: FeedModel?) {}
func didScrolledToNextVideo(videoAsset: FeedModel?) {}
func didScrolledToPreviousVideo(videoAsset: FeedModel?) {}
func didVideoWatched(videoAsset: FeedModel?, currentDuration: Int64, totalDuration: Int64) {}
func didMediaReady(videoAsset: FeedModel?) {}
func onVideoRestarted(videoAsset: FeedModel?) {}
func didVideoStarted(videoAsset: FeedModel?) {}
func didSelectlike(videoAsset: FeedModel?) {}
func didSelectComment(videoAsset: FeedModel?) {}
func didVideoPlayPause(isPlaying: Bool?, videoAsset: FeedModel?) {}
func didDoubleTap(videoAsset: FeedModel?) {}
func didPlaybackCompleted(videoAsset: FeedModel?) {}
After all these settings run the app and app should look like the below image based on UGC or PGC use case: