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).
![](https://docs.conscent.ai/~gitbook/image?url=https%3A%2F%2F380225236-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FcoDfVWiJBvgTq8DbifIH%252Fuploads%252FZDyQNWH7JXjMGat4Vr7n%252FImage%252018-04-24%2520at%25202.43%25E2%2580%25AFPM.jpg%3Falt%3Dmedia%26token%3D21bda580-45d3-4478-90c9-4026b83a13e7&width=768&dpr=4&quality=100&sign=cd8d4658&sv=1)
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