The RudderDBEncryption class accepts the following parameters:
Specifies whether to encrypt/decrypt the database.
Key used to encrypt/decrypt the database.
To remove encryption from a database, configure the RudderDBEncryption object with your encryption key and set enable to false.
Instructions for iOS
The rudder_plugin_db_encryption uses the SQLCipher Cocoapod under the hood to perform encryption. This Cocoapod requires the removal of any references to the standard SQLite system library for it to function as expected.
If you set up a project to inadvertently include a linking reference against the standard SQLite library before SQLCipher, it is possible that the application builds and runs correctly but does not use SQLCipher for encryption. This is not a problem for most projects but there are certain cases where unintentional SQLite linking can occur.
One such example is when using CocoaPods or some other sub-project that declares a dependency on the SQLite3 library. In this case, adding a pod to a project can silently modify the project settings in such a way that SQLCipher is not properly linked.
You can identify and fix the above linking issue during the development stage by looking for the below error log from the SDK:
RSDBPersistentManager: createDB: Cannot encrypt the Database as SQLCipher wasn't linked correctly.
To fix the linking issue, add a linker flag to your project settings to ensure that the Xcode links SQLCipher before SQLite. Follow these steps:
Open the project-level build settings. These are the global project settings, not for the individual application target.
Locate the Other Linker Flags setting and add one of the following commands depending on how you are integrating SQLCipher into the app.
If you are not adding SQLCipher into the app on your own and only using rudder_plugin_db_encryption, then see only the points 3 and 4 in the below table - depending on whether you are using use_frameworks! in your app’s ios/Podfile.
When using SQLCipher commercial edition static libraries
Enabling/disabling events for specific destinations
The Flutter SDK lets you enable or disable sending events to a specific destination or all destinations connected to a source. You can specify these destinations by creating an object shown in the following snippet:
RudderOptionoptions=newRudderOption();// represents all destinations connected to the source, the default value is true.
options.putIntegration("All",false);// specifying destination by its display name
options.putIntegration("Mixpanel",false);// specifying destination by its Factory object
Make sure the destination names that you pass while specifying the destinations match exactly with the names listed in the RudderStack dashboard.
You can pass the destinations to the SDK in the following two ways:
Method 1. Passing destinations while initializing the SDK
This is helpful when you want to enable or disable sending the events to the destinations across all the API calls made using the SDK.
If you specify the destinations while initializing the SDK and in the event, then the SDK considers only the destinations specified at the event level.
Setting custom objects for destinations
Starting from v2.4.0, you can also use the putIntegration method on the RudderOption object to set custom objects used by the device mode destinations.
This feature is applicable only for the web platform.
For mobile platforms, the putIntegration method accepts the custom objects but does not set them for the destination. Instead, it only enables sending events to that destination (equivalent to options.putIntegration("<destination>", true);).
An example of setting a custom object to Google Analytics 4 via a track call:
You can use your device token to pass push notifications to the destinations that support them. RudderStack sets this token under context.device.token. To set a custom device token, the SDK supports the putDeviceToken method.
An example of setting a custom device token is shown below:
If you run into any issues when using the Flutter SDK, you can enable the SDK’s logging feature to determine the issue. To do so, follow these steps:
Import RudderLogger by running the following command:
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
for the working of basic functionalities of the website. We also use third-party cookies that
analyze and understand how you use this website. These cookies will be stored in your browser
consent. You also have the option to opt-out of these cookies. But opting out of some of these
have an effect on your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.