iOS(Swift)
This guide provides step-by-step instructions on how to include the Conscent.ai Plugin in your iOS app. The Conscent.ai Plugin is developed in swift Language.
Pre-requisites
Conscent.ai iOS SDK supports iOS 13.0 and above.
Parameters | Description |
---|---|
contentID (string) | This will be your article or content id for which detail needs to be checked. |
parentView | Pass the view on which you are going to show your content. |
completionDelegate | This will be used to handle the success and failure cases. Pass the class as the delegate where you want to handle success or failure. This delegate is of the protocol CCPluginCompletionHandlerDelegate, which has three methods: purchasedOrNot(), onPaywallVisible(paywallType, paywallDisplayType, paywallHeight), and onCustomLinkSlot(link, contentId) that will be triggered in case of success and failure of the process. |
subscriberDelegate(optional) | This is an optional callback that will be called if you pass your class as its delegate. It will be triggered when the subscription button is tapped. If you don't pass it in your delegate, it will not show the subscription view. subscriberDelegate, which has one method: subscribeBtnTap() which will be triggered whenever the user clicks the Subscribe Button. |
signInDelegate(optional) | This is an optional callback that will be called if you pass your class as its delegate. It will be triggered when the sign-in button is tapped. If you don't pass it in your delegate, it will not show the sign-in view. signInDelegate, which has one method: signInTap() that will be triggered when the user clicks the signin button. |
eventParamsDelegate(optional) | This will be used to get the events params. Pass the class as the delegate where you want to handle success. This delegate is of the protocol CCPluginEventParamsDelegate, which has methods: success(paywallId: String, contentId: String, paywallType: String, clientId: String, anonId: String) that will be triggered in case of google login click. |
googleLogInDelegate(optional) | This will be used to trigger your Google sign. This delegate is of the protocol CCPluginGoogleLogInDelegate, which has methods: startGoogleLogin() that will be triggered in case of google login click. |
Mandatory Step
In your Project go to your target and in the URL types add a new one with URL schemes "conscent".
This is important to handle redirection or app launches from the browser.
call below function inside of
openURLContexts
scene delegate(inbuilt in iOS).
You need to call CCplugin.shared.exitSDK() while leaving the scope of current controller.
Call the below function and pass the userId, after the user has logged in:
Demo APP Link
Last updated