Skip to content

Commit 5245c1e

Browse files
authored
Merge pull request #1 from context-sdk/reinhard/pre-release
chore: Small changes before publishing
2 parents 843597a + e444e21 commit 5245c1e

File tree

7 files changed

+67
-59
lines changed

7 files changed

+67
-59
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# context_sd Changelog
2+
3+
**[Android] 1.0.0 - 2024-10-01**
4+
5+
- Initial Release

README.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,59 @@
11
# context_sdk
22

3-
A Flutter plugin to expose the iOS ContextSDK Framework to Flutter applications.
3+
ContextSDK for Flutter
44

5+
## Supported Platforms
6+
7+
- iOS - 14.0 and higher
8+
- Android - Coming Soon
9+
10+
## Overview
11+
12+
- **Step 1**: Add ContextSDK to your app
13+
- **Step 2**: Track conversion events
14+
- **Step 3**: Ship an App Store update with ContextSDK
15+
16+
## Installation
17+
18+
**Step 1:** Add `context_sdk` to your `pubspec.yaml`
19+
20+
**Step 2:** Ensure minimum Deployment Target
21+
22+
ContextSDK requires a minimum deployment target of iOS 14.0, be sure to update your `ios/Podfile` to specify 14.0 or higher:
23+
24+
```ruby
25+
platform :ios, '14.0'
26+
```
27+
28+
### Activating ContextSDK
29+
30+
After you installed ContextSDK, you need to add your license key. [Register here](https://console.contextsdk.com/register) to get started. Call this on app start.
31+
32+
```dart
33+
import 'package:context_sdk/context_sdk.dart';
34+
35+
final _contextSdkPlugin = ContextSdk();
36+
37+
_contextSdkPlugin.setup("YOUR_LICENSE_KEY_HERE");
38+
```
39+
40+
## Track conversion Events
41+
42+
To get the most use out of ContextSDK make sure to log data for all your upsell prompts. For more details check out the [documentation](https://docs.insights.contextsdk.com/)
43+
44+
```dart
45+
import 'package:context_sdk/context_sdk.dart';
46+
47+
final _contextSdkPlugin = ContextSdk();
48+
49+
// Make sure to call this immediately before showing the prompt to the user.
50+
_contextSdkPlugin.optimize("upsell", null, null, (context) async {
51+
// Show the upgrade prompt here right after fetching the context
52+
// Once you know if the user purchased or dismissed the upsell, log the outcome:
53+
context.log(Outcome.positive);
54+
});
55+
```
56+
57+
## Go Live
58+
59+
Now all that's left is to ship your update to the App Store to start gaining context insights. Continue to the [release page](https://docs.insights.contextsdk.com/release/) for a final check before shipping, as well as other deployment tips.

example/integration_test/plugin_integration_test.dart

Lines changed: 0 additions & 25 deletions
This file was deleted.

example/lib/main.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class _MyAppState extends State<MyApp> {
102102
child: const Text('Track User Action')),
103103
ElevatedButton(
104104
onPressed: () async => {
105-
_contextSdkPlugin.calibrate("my_flow", 4, {
105+
_contextSdkPlugin.calibrate("my_flow", null, {
106106
'string': 'string',
107107
'int': 14,
108108
'bool': true,
@@ -121,7 +121,7 @@ class _MyAppState extends State<MyApp> {
121121
child: const Text('Calibrate')),
122122
ElevatedButton(
123123
onPressed: () async => {
124-
_contextSdkPlugin.optimize("my_flow", 4, {
124+
_contextSdkPlugin.optimize("my_flow", null, {
125125
'string': 'string',
126126
'int': 14,
127127
'bool': true,
@@ -140,7 +140,7 @@ class _MyAppState extends State<MyApp> {
140140
child: const Text('Optimize')),
141141
ElevatedButton(
142142
onPressed: () async => {
143-
_contextSdkPlugin.fetchContext("my_flow", 4, {
143+
_contextSdkPlugin.fetchContext("my_flow", 3, {
144144
'string': 'string',
145145
'int': 14,
146146
'bool': true,
@@ -159,7 +159,7 @@ class _MyAppState extends State<MyApp> {
159159
child: const Text('Fetch Context')),
160160
ElevatedButton(
161161
onPressed: () async => {
162-
_contextSdkPlugin.fetchContext("my_flow", 4, {
162+
_contextSdkPlugin.fetchContext("my_flow", 3, {
163163
'string': 'string',
164164
'int': 14,
165165
'bool': true,

example/test/widget_test.dart

Lines changed: 0 additions & 27 deletions
This file was deleted.

ios/context_sdk.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ A Flutter plugin for ContextSDK.
2626
# plugin's privacy impact, and then uncomment this line. For more information,
2727
# see https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
2828
s.resource_bundles = {'context_sdk_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
29-
s.dependency("ContextSDK", '4.5.1')
29+
s.dependency("ContextSDK", '4.6.0')
3030
end

lib/real_world_context.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'package:context_sdk/context_sdk_platform_interface.dart';
22

3-
/// /// Represents a full context event in a moment in time. Use [RealWorldContext.log] to log an event.
3+
/// Represents a full context event in a moment in time. Use [RealWorldContext.log] to log an event.
44
class RealWorldContext {
55
// Keeps the finalizer itself reachable, otherwise it might be disposed
66
// before the finalizer callback gets a chance to run.

0 commit comments

Comments
 (0)