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(accessTime), success(accessType), onPaywallVisible(paywallType, paywallDisplayType, paywallHeight),loginSuccess(message, userId, authToken), |
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:
To enable Apple login follow these steps:
Xcode Steps:
Open Xcode project.
Go to Target Settings → Signing & Capabilities.
Add "Sign in with Apple" capability.
Verify entitlements.
Ensure proper signing.
App Store Connect Steps:
Go to App Store Connect.
Select the app under "My Apps."
Go to "App Information."
Add "Sign in with Apple" information (privacy policy and terms of service URLs).
Enable "Sign in with Apple."
Submit changes for review.
Demo APP Link
Last updated