Skip to content

Commit 016f35d

Browse files
authored
Merge pull request #93 from mindbox-cloud/release/2.10.0
Release/2.10.0
2 parents 75e80aa + 09359d7 commit 016f35d

File tree

127 files changed

+3099
-1151
lines changed

Some content is hidden

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

127 files changed

+3099
-1151
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Gitleaks Secrets Validate
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
jobs:
6+
scan:
7+
name: gitleaks
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Run Gitleaks
16+
uses: gitleaks/[email protected]
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
GITLEAKS_LICENSE: ${{ secrets.MINDBOX_GITLEAKS_LICENSE }}

mindbox_ios/example/.gitignore renamed to example/flutter_example/.gitignore

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,7 @@
88
.buildlog/
99
.history
1010
.svn/
11-
mindbox_ios_example.iml
12-
pubspec.lock
13-
.metadata
14-
.packages
15-
.flutter-plugins-dependencies
16-
.flutter-plugins
17-
ios/Podfile.lock
18-
ios/Pods/
19-
android/gradlew
20-
android/gradlew.bat
21-
android/local.properties
11+
migrate_working_dir/
2212

2313
# IntelliJ related
2414
*.iml
@@ -37,14 +27,10 @@ android/local.properties
3727
.dart_tool/
3828
.flutter-plugins
3929
.flutter-plugins-dependencies
40-
.packages
4130
.pub-cache/
4231
.pub/
4332
/build/
4433

45-
# Web related
46-
lib/generated_plugin_registrant.dart
47-
4834
# Symbolication related
4935
app.*.symbols
5036

@@ -55,3 +41,6 @@ app.*.map.json
5541
/android/app/debug
5642
/android/app/profile
5743
/android/app/release
44+
45+
/android/app/google-services.json
46+
/android/app/agconnect-services.json

example/flutter_example/.metadata

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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: "54e66469a933b60ddf175f858f82eaeb97e48c8d"
8+
channel: "stable"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
17+
base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
18+
- platform: android
19+
create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
20+
base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
21+
- platform: ios
22+
create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
23+
base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
24+
- platform: linux
25+
create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
26+
base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
27+
- platform: macos
28+
create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
29+
base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
30+
- platform: web
31+
create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
32+
base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
33+
- platform: windows
34+
create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
35+
base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
36+
37+
# User provided section
38+
39+
# List of Local paths (relative to this file) that should be
40+
# ignored by the migrate tool.
41+
#
42+
# Files that are not part of the templates will be ignored by default.
43+
unmanaged_files:
44+
- 'lib/main.dart'
45+
- 'ios/Runner.xcodeproj/project.pbxproj'

example/flutter_example/README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Example app for Mindbox SDK for flutter
2+
3+
This is an example of SDK [integration](https://developers.mindbox.ru/docs/flutter-sdk-integration)
4+
5+
## Getting Started
6+
7+
### IOS
8+
1. Clone [flutter-sdk repository](https://github.com/mindbox-cloud/flutter-sdk).
9+
2. Go to `flutter-sdk/example/flutter_example`.
10+
3. From the terminal:
11+
```
12+
flutter pub get
13+
```
14+
4. Make sure you have CocoaPods installed or install it according to the instructions.
15+
5. Go to `ios/Runner`.
16+
6. Install pods:
17+
```
18+
pod install
19+
```
20+
7. Launch `Runner.xcworkspace` .
21+
8. Launch app.
22+
23+
Now you can test the in-app on the simulator.
24+
In our admin panel there are already 3 ready-made in-apps that you can look at.
25+
To run the application on a real device and try push notifications, follow the instructions below.
26+
27+
9. Change [team](https://developers.mindbox.ru/docs/ios-get-keys) and bundle identifiers and App Group name for next targets:
28+
- Runner
29+
- MindboxNotificationServiceExtension
30+
- MindboxNotificationContentExtension
31+
10. [Configure your endpoints](https://developers.mindbox.ru/docs/add-ios-integration).
32+
11. Change domain and endpoints in the `main.dart` to yours.
33+
34+
### Android
35+
1. Clone [flutter-sdk repository](https://github.com/mindbox-cloud/flutter-sdk).
36+
2. Go to `flutter-sdk/example/flutter_example`.
37+
3. From the terminal:
38+
```
39+
flutter pub get
40+
```
41+
4. Open `android` folder in Android Studio.
42+
5. Change `namespace` and `applicationId` in `app/build.gradle` to yours.
43+
6. Add `google-services.json` and `agconnect-services.json` to `android/app`.
44+
- [Get google-services.json](https://developers.mindbox.ru/docs/firebase-get-keys)
45+
- [Get agconnect-services.json](https://developers.mindbox.ru/docs/huawei-get-keys)
46+
7. [Configure your endpoints](https://developers.mindbox.ru/docs/add-ios-integration).
47+
8. Change domain and endpoints in the `main.dart` to yours.
48+
8. Launch app.
49+
50+
### SDK functionality testing
51+
1. To check innap when opening:
52+
- [Read this](https://help.mindbox.ru/docs/in-app-what-is).
53+
- Open app.
54+
2. To check the inapp anywhere in the application:
55+
- [Read this](https://help.mindbox.ru/docs/in-app-location).
56+
- Replace `operationSystemName` in `syncOperation` and `asyncOperation` in `view_model.dart`.
57+
- Click to the button `Show in-app` opposite the selected operation.
58+
3. To check push notifications:
59+
- Read [iOS](https://developers.mindbox.ru/docs/ios-send-push-notifications-flutter).
60+
- Read [android with Firebase](https://developers.mindbox.ru/docs/firebase-send-push-notifications-flutter).
61+
- Read [android with Huawei](https://developers.mindbox.ru/docs/huawei-send-push-notifications-flutter).
62+
- Send a notification from your account.
63+
4. To check rich-push notifications:
64+
- Read [iOS](https://developers.mindbox.ru/docs/ios-send-rich-push-flutter).
65+
- Read [android with Firebase](https://developers.mindbox.ru/docs/firebase-send-push-notifications-flutter).
66+
- Read [android with Huawei](https://developers.mindbox.ru/docs/huawei-send-push-notifications-flutter).
67+
- Send a notification from your account.
68+
69+
### Additionally
70+
- Currently the In-App only comes once per session.
71+
- There are comments and links in the flutter example code that can help you.

mindbox_ios/example/analysis_options.yaml renamed to example/flutter_example/analysis_options.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ linter:
1313
# The lint rules applied to this project can be customized in the
1414
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
1515
# included above or to enable additional rules. A list of all available lints
16-
# and their documentation is published at
17-
# https://dart-lang.github.io/linter/lints/index.html.
16+
# and their documentation is published at https://dart.dev/lints.
1817
#
1918
# Instead of disabling a lint rule for the entire project in the
2019
# section below, it can also be suppressed for a single line of code
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
id 'com.google.gms.google-services'
6+
id 'com.huawei.agconnect'
7+
}
8+
9+
def localProperties = new Properties()
10+
def localPropertiesFile = rootProject.file('local.properties')
11+
if (localPropertiesFile.exists()) {
12+
localPropertiesFile.withReader('UTF-8') { reader ->
13+
localProperties.load(reader)
14+
}
15+
}
16+
17+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
18+
if (flutterVersionCode == null) {
19+
flutterVersionCode = '1'
20+
}
21+
22+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
23+
if (flutterVersionName == null) {
24+
flutterVersionName = '1.0'
25+
}
26+
27+
android {
28+
namespace "cloud.mindbox.flutter_example"
29+
compileSdk flutter.compileSdkVersion
30+
ndkVersion flutter.ndkVersion
31+
32+
compileOptions {
33+
sourceCompatibility JavaVersion.VERSION_1_8
34+
targetCompatibility JavaVersion.VERSION_1_8
35+
}
36+
37+
kotlinOptions {
38+
jvmTarget = '1.8'
39+
}
40+
41+
sourceSets {
42+
main.java.srcDirs += 'src/main/kotlin'
43+
}
44+
45+
defaultConfig {
46+
applicationId "cloud.mindbox.flutter_example"
47+
minSdkVersion flutter.minSdkVersion
48+
targetSdkVersion flutter.targetSdkVersion
49+
versionCode flutterVersionCode.toInteger()
50+
versionName flutterVersionName
51+
multiDexEnabled true
52+
}
53+
54+
buildTypes {
55+
release {
56+
signingConfig signingConfigs.debug
57+
}
58+
}
59+
buildToolsVersion '34.0.0'
60+
}
61+
62+
flutter {
63+
source '../..'
64+
}
65+
66+
ext.mindbox_version = "2.9.1"
67+
68+
dependencies {
69+
implementation 'androidx.multidex:multidex:2.0.1'
70+
//https://developers.mindbox.ru/docs/firebase-send-push-notifications-flutter
71+
implementation "cloud.mindbox:mobile-sdk:$mindbox_version"
72+
implementation "cloud.mindbox:mindbox-firebase:$mindbox_version"
73+
implementation platform('com.google.firebase:firebase-bom:32.8.1')
74+
implementation 'com.google.firebase:firebase-messaging:23.4.1'
75+
//https://developers.mindbox.ru/docs/huawei-send-push-notifications-flutter
76+
implementation "cloud.mindbox:mindbox-huawei:$mindbox_version"
77+
implementation 'com.huawei.hms:push:6.11.0.300'
78+
}

mindbox_android/example/android/app/src/debug/AndroidManifest.xml renamed to example/flutter_example/android/app/src/debug/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2-
<!-- Flutter needs it to communicate with the running application
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
34
to allow setting breakpoints, to provide hot reload, etc.
45
-->
56
<uses-permission android:name="android.permission.INTERNET"/>
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2-
<application
3-
android:label="mindbox_android_example"
2+
3+
<application
4+
android:label="flutter_example"
5+
android:name=".MainApplication"
46
android:icon="@mipmap/ic_launcher">
7+
8+
<service android:name=".MindboxFirebaseMessagingService" android:exported="false">
9+
<intent-filter>
10+
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
11+
</intent-filter>
12+
</service>
13+
14+
<meta-data
15+
android:name="com.huawei.hms.client.channel.androidMarket"
16+
android:value="false" />
17+
<service android:name=".MindboxHuaweiMessagingService" android:exported="false">
18+
<intent-filter>
19+
<action android:name="com.huawei.push.action.MESSAGING_EVENT"/>
20+
</intent-filter>
21+
</service>
22+
523
<activity
6-
android:exported="true"
724
android:name=".MainActivity"
25+
android:exported="true"
826
android:launchMode="singleTop"
927
android:theme="@style/LaunchTheme"
1028
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
@@ -18,15 +36,6 @@
1836
android:name="io.flutter.embedding.android.NormalTheme"
1937
android:resource="@style/NormalTheme"
2038
/>
21-
<!-- Displays an Android View that continues showing the launch screen
22-
Drawable until Flutter paints its first frame, then this splash
23-
screen fades out. A splash screen is useful to avoid any visual
24-
gap between the end of Android's launch screen and the painting of
25-
Flutter's first frame. -->
26-
<meta-data
27-
android:name="io.flutter.embedding.android.SplashScreenDrawable"
28-
android:resource="@drawable/launch_background"
29-
/>
3039
<intent-filter>
3140
<action android:name="android.intent.action.MAIN"/>
3241
<category android:name="android.intent.category.LAUNCHER"/>
@@ -37,5 +46,11 @@
3746
<meta-data
3847
android:name="flutterEmbedding"
3948
android:value="2" />
49+
4050
</application>
51+
<queries>
52+
<intent>
53+
<action android:name="com.huawei.hms.core.aidlservice" />
54+
</intent>
55+
</queries>
4156
</manifest>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package cloud.mindbox.flutter_example
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity: FlutterActivity()

0 commit comments

Comments
 (0)