Skip to content

Commit fa9564d

Browse files
committed
Version 0.0.1
1 parent ffae905 commit fa9564d

File tree

96 files changed

+2926
-19
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2926
-19
lines changed

.gitignore

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,47 @@
1-
# See https://www.dartlang.org/guides/libraries/private-files
1+
.DS_Store
2+
.atom/
3+
.idea/
4+
.vscode/
25

3-
# Files and directories created by pub
4-
.dart_tool/
56
.packages
6-
build/
7-
# If you're building an application, you may want to check-in your pubspec.lock
7+
.pub/
8+
.dart_tool/
89
pubspec.lock
10+
flutter_export_environment.sh
11+
12+
examples/all_plugins/pubspec.yaml
913

10-
# Directory created by dartdoc
11-
# If you don't generate documentation locally you can remove this line.
12-
doc/api/
14+
Podfile
15+
Podfile.lock
16+
Pods/
17+
.symlinks/
18+
**/Flutter/App.framework/
19+
**/Flutter/ephemeral/
20+
**/Flutter/Flutter.framework/
21+
**/Flutter/Generated.xcconfig
22+
**/Flutter/flutter_assets/
23+
24+
ServiceDefinitions.json
25+
xcuserdata/
26+
**/DerivedData/
27+
28+
local.properties
29+
keystore.properties
30+
.gradle/
31+
gradlew
32+
gradlew.bat
33+
gradle-wrapper.jar
34+
.flutter-plugins-dependencies
35+
*.iml
36+
37+
generated_plugin_registrant.dart
38+
GeneratedPluginRegistrant.h
39+
GeneratedPluginRegistrant.m
40+
GeneratedPluginRegistrant.java
41+
GeneratedPluginRegistrant.swift
42+
build/
43+
.flutter-plugins
1344

14-
# Avoid committing generated Javascript files:
15-
*.dart.js
16-
*.info.json # Produced by the --dump-info flag.
17-
*.js # When generated by dart2js. Don't specify *.js if your
18-
# project includes source files written in JavaScript.
19-
*.js_
20-
*.js.deps
21-
*.js.map
45+
.project
46+
.classpath
47+
.settings

.metadata

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: bbfbf1770cca2da7c82e887e4e4af910034800b6
8+
channel: stable
9+
10+
project_type: plugin

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Changelog
2+
3+
## 0.0.1
4+
5+
### Added
6+
- Activate (app configure)
7+
- Attribution tracker integration
8+
- Get paywalls
9+
- Make purchase
10+
- Restore purchases
11+
- Validate purchase (Android)
12+
- Validate receipt (iOS)
13+
- Get active purchases

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Adapty
3+
Copyright (c) 2020 Adapty Tech Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

README.md

Lines changed: 167 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,167 @@
1-
# AdaptySDK-Flutter
1+
# Adapty Flutter SDK
2+
3+
![Adapty: Win back churned subscribers in your iOS app](https://raw.githubusercontent.com/adaptyteam/AdaptySDK-iOS/master/adapty.png)
4+
5+
## Requirements
6+
7+
iOS:
8+
- iOS 9.0+
9+
- Xcode 10.2+
10+
11+
Android:
12+
- Android 4.1+
13+
14+
## Installation
15+
16+
Add Adapty as a project dependency in `pubspec.yaml`:
17+
```yaml
18+
dependencies:
19+
adapty_flutter:
20+
git:
21+
url: git@github.com:adaptyteam/AdaptySDK-Flutter.git
22+
```
23+
24+
## Usage
25+
26+
### Configure your app
27+
28+
Add the following in your `main.dart`:
29+
30+
```dart
31+
void main() async {
32+
await AdaptyFlutter.activate("PUBLIC_SDK_KEY",
33+
customerUserId: "YOUR_USER_ID");
34+
/* ... */
35+
}
36+
```
37+
If your app doesn't have user IDs, you can use **`.activate("PUBLIC_SDK_KEY")`** or pass null for the **`customerUserId`**. Anyway, you can update **`customerUserId`** later within **`.identify()`** request.
38+
39+
Return **`true`** if success.
40+
41+
### Convert anonymous user to identifiable user
42+
43+
**`Not implemented`**
44+
45+
### Observer mode
46+
47+
**`Not implemented`**
48+
49+
### Update customer profile
50+
51+
**`Not implemented`**
52+
53+
### Attribution tracker integration
54+
55+
To integrate with attribution system, just pass attribution you receive to Adapty method.
56+
57+
```dart
58+
await AdaptyFlutter.updateAttribution(Map attribution, String source, {String userId});
59+
```
60+
61+
**`attribution`** is **`Map`** object.
62+
For **`source`** possible values are: **`AdaptyConstants.adjust`**, **`AdaptyConstants.appsflyer`** and **`AdaptyConstants.branch`**.
63+
64+
Return **`true`** if success.
65+
66+
### Get paywalls
67+
68+
```dart
69+
await AdaptyFlutter.getPaywalls();
70+
```
71+
Return **`GetPaywallsResult`** model.
72+
73+
### Make purchase
74+
75+
```dart
76+
await AdaptyFlutter.makePurchase(productId);
77+
```
78+
Return **`MakePurchaseResult`** model.
79+
80+
### Restore purchases
81+
82+
```dart
83+
await AdaptyFlutter.restorePurchases();
84+
```
85+
Return **`AdaptyResult`** model.
86+
87+
### Validate purchase (Android)
88+
89+
```dart
90+
await AdaptyFlutter.validatePurchase(purchaseType, productId, purchaseToken)
91+
```
92+
93+
**`purchaseType`**, **`productId`** and **`purchaseToken`** are required and can't be empty.
94+
95+
Return **`AdaptyResult`** model.
96+
97+
### Validate receipt (iOS)
98+
99+
```dart
100+
await AdaptyFlutter.validateReceipt(receipt)
101+
```
102+
103+
**`receipt`** is required and can't be empty.
104+
105+
Return **`AdaptyResult`** model.
106+
107+
### Get user purchases info
108+
109+
**`Not implemented`**
110+
111+
### Get active purchases
112+
113+
```dart
114+
await AdaptyFlutter.getActivePurchases(paidAccessLevel)
115+
```
116+
117+
Return **`GetActivePurchasesResult`** model.
118+
119+
### Listening for purchaser info updates
120+
121+
**`Not implemented`**
122+
123+
### Logout user
124+
125+
**`Not implemented`**
126+
127+
### Models
128+
**`AdaptyResult`**:
129+
| Name | Description |
130+
| -------- | ------------- |
131+
| errorCode | Code of error. Null if the result is successful. |
132+
| errorMessage | Error message. Null if the result is successful. |
133+
| sucess() | Return true if the result is successful. |
134+
135+
**`AdaptyProduct`**:
136+
| Name | Description |
137+
| -------- | ------------- |
138+
| id | Identifier of the product in vendor system (App Store/Google Play etc.). |
139+
| title | The name of the product. |
140+
| description | A description of the product. |
141+
| price | The cost of the product in the local currency. |
142+
| localizedPrice | Localized price of the product. |
143+
| currency | Product locale currency. |
144+
145+
**`GetPaywallsResult`**:
146+
| Name | Description |
147+
| -------- | ------------- |
148+
| paywalls | List of Adapty paywalls id's. |
149+
| products | List of Adapty Product's. |
150+
151+
**`MakePurchaseResult`**:
152+
| Name | Description |
153+
| -------- | ------------- |
154+
| purchaseToken | Android purchase token. |
155+
| purchaseType | Android purchase type |
156+
| receipt | iOS receipt of purchase |
157+
158+
**`GetActivePurchasesResult`**:
159+
| Name | Description |
160+
| -------- | ------------- |
161+
| activeSubscription | True if user has an active active subscription. |
162+
| nonSubscriptionsProductIds | List of active non subscription products id's. |
163+
| activeSubscriptionProductId | Identifier of active subscription in vendor system (App Store/Google Play etc.).|
164+
165+
## License
166+
167+
Adapty is available under the MIT license.

adapty_flutter.iml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
7+
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
8+
<excludeFolder url="file://$MODULE_DIR$/.idea" />
9+
<excludeFolder url="file://$MODULE_DIR$/.pub" />
10+
<excludeFolder url="file://$MODULE_DIR$/build" />
11+
<excludeFolder url="file://$MODULE_DIR$/example/.dart_tool" />
12+
<excludeFolder url="file://$MODULE_DIR$/example/.pub" />
13+
<excludeFolder url="file://$MODULE_DIR$/example/build" />
14+
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/adapty_flutter/.dart_tool" />
15+
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/adapty_flutter/.pub" />
16+
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/adapty_flutter/build" />
17+
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/adapty_flutter/example/.dart_tool" />
18+
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/adapty_flutter/example/.pub" />
19+
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/adapty_flutter/example/build" />
20+
</content>
21+
<orderEntry type="sourceFolder" forTests="false" />
22+
<orderEntry type="library" name="Dart SDK" level="project" />
23+
<orderEntry type="library" name="Flutter Plugins" level="project" />
24+
</component>
25+
</module>

android/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures

android/build.gradle

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
group 'com.adapty.flutter'
2+
version '1.0-SNAPSHOT'
3+
4+
buildscript {
5+
ext.kotlin_version = '1.4.0'
6+
repositories {
7+
google()
8+
jcenter()
9+
}
10+
11+
dependencies {
12+
classpath 'com.android.tools.build:gradle:4.0.1'
13+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14+
}
15+
}
16+
17+
rootProject.allprojects {
18+
repositories {
19+
google()
20+
jcenter()
21+
maven { url 'https://jitpack.io' }
22+
}
23+
}
24+
25+
apply plugin: 'com.android.library'
26+
apply plugin: 'kotlin-android'
27+
28+
android {
29+
compileSdkVersion 28
30+
31+
sourceSets {
32+
main.java.srcDirs += 'src/main/kotlin'
33+
}
34+
defaultConfig {
35+
minSdkVersion 16
36+
}
37+
lintOptions {
38+
disable 'InvalidPackage'
39+
}
40+
}
41+
42+
dependencies {
43+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
44+
implementation 'com.github.adaptyteam:AdaptySDK-Android:0.3.1'
45+
implementation 'com.android.billingclient:billing:3.0.0'
46+
implementation 'com.google.code.gson:gson:2.8.6'
47+
}

android/gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
org.gradle.jvmargs=-Xmx1536M
2+
android.enableR8=true
3+
android.useAndroidX=true
4+
android.enableJetifier=true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
zipStoreBase=GRADLE_USER_HOME
4+
zipStorePath=wrapper/dists
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip

android/settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'adapty_flutter'

android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<manifest package="com.adapty.flutter" />

0 commit comments

Comments
 (0)