v1.1.27 posthog_session integration

This commit is contained in:
Tibor Bossanyi (Freelancer) 2022-11-22 23:34:02 +01:00
parent ba36a10790
commit dbdcf2f239
9 changed files with 7251 additions and 28 deletions

View File

@ -33,8 +33,6 @@ if (keystorePropertiesFile.exists()) {
} }
android { android {
compileSdkVersion 31
sourceSets { sourceSets {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
} }
@ -45,8 +43,8 @@ android {
defaultConfig { defaultConfig {
applicationId "com.aitrainer.aitrainer_app" applicationId "com.aitrainer.aitrainer_app"
minSdkVersion 20 minSdkVersion 21
targetSdkVersion 30 targetSdkVersion 31
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
multiDexEnabled true multiDexEnabled true
@ -85,6 +83,9 @@ dependencies {
implementation 'com.android.support:multidex:1.0.3' implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.firebase:firebase-messaging:20.1.0' implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation 'com.google.firebase:firebase-core:20.0.0' implementation 'com.google.firebase:firebase-core:20.0.0'
implementation('com.google.firebase:firebase-auth') {
exclude module: "play-services-safetynet"
}
implementation 'com.google.firebase:firebase-inappmessaging-display:20.1.1' implementation 'com.google.firebase:firebase-inappmessaging-display:20.1.1'
} }
sourceCompatibility = '1.8' sourceCompatibility = '1.8'

View File

@ -8,7 +8,7 @@
<application android:name="${applicationName}" android:label="WorkoutTest" android:icon="@mipmap/launcher_icon"> <application android:name="${applicationName}" android:label="WorkoutTest" android:icon="@mipmap/launcher_icon">
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id" /> <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id" />
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/> <meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>
<activity android:name="io.flutter.embedding.android.FlutterActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize" android:allowBackup="false" android:fullBackupContent="false"> <activity android:name="io.flutter.embedding.android.FlutterActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize" android:allowBackup="false" android:fullBackupContent="false" android:exported="true">
<!-- Specifies an Android theme to apply to this Activity as soon as <!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues while the Flutter UI initializes. After that, this theme continues
@ -47,7 +47,7 @@
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/> <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
<activity android:name="com.facebook.FacebookActivity" android:configChanges= <activity android:name="com.facebook.FacebookActivity" android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" /> "keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" android:exported="false"/>
<activity android:name="com.facebook.CustomTabActivity" android:exported="true"> <activity android:name="com.facebook.CustomTabActivity" android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
@ -64,6 +64,6 @@
</application> </application>
<queries> <queries>
<provider android:authorities="com.facebook.katana.provider.PlatformProvider" /> <provider android:authorities="com.facebook.katana.provider.PlatformProvider" android:exported="false"/>
</queries> </queries>
</manifest> </manifest>

7216
android/my-logs.txt Normal file

File diff suppressed because one or more lines are too long

View File

@ -56,7 +56,7 @@ import 'package:matomo_tracker/matomo_tracker.dart';
import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:posthog_flutter/posthog_flutter.dart'; import 'package:posthog_session/posthog_session.dart';
import 'package:upgrader/upgrader.dart'; import 'package:upgrader/upgrader.dart';
import 'bloc/account/account_bloc.dart'; import 'bloc/account/account_bloc.dart';
import 'bloc/body_development/body_development_bloc.dart'; import 'bloc/body_development/body_development_bloc.dart';
@ -112,14 +112,14 @@ Future<Null> main() async {
siteId: 3, siteId: 3,
url: 'https://matomo.workouttest.org/matomo.php', url: 'https://matomo.workouttest.org/matomo.php',
); );
}
Posthog().setContext({ Posthog().setContext({
'device': { 'token':'v1.1.26'
'token': 'v1.1.26', });
} Posthog().identify(userId: 0, properties: {
'token':'v1.1.26'
}); });
}
print(" -- FireBase init.."); print(" -- FireBase init..");
await FirebaseApi().initializeFlutterFire(); await FirebaseApi().initializeFlutterFire();
} }
@ -198,7 +198,7 @@ class WorkoutTestApp extends StatelessWidget {
Upgrader().installAppStoreListingURL(Platform.isAndroid Upgrader().installAppStoreListingURL(Platform.isAndroid
? "https://play.google.com/store/apps/details?id=com.aitrainer.aitrainer_app" ? "https://play.google.com/store/apps/details?id=com.aitrainer.aitrainer_app"
: "https://apps.apple.com/hu/app/workouttest/id1515271425"); : "https://apps.apple.com/hu/app/workouttest/id1515271425");
//Upgrader().installAppStoreVersion("1.1.19"); Upgrader().installAppStoreVersion("1.1.26");
// On iOS, the default behavior will be to use the App Store version of // On iOS, the default behavior will be to use the App Store version of
// the app, so update the Bundle Identifier in example/ios/Runner with a // the app, so update the Bundle Identifier in example/ios/Runner with a
// valid identifier already in the App Store. // valid identifier already in the App Store.

View File

@ -35,6 +35,7 @@ import 'package:firebase_remote_config/firebase_remote_config.dart';
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart'; import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
import 'package:matomo_tracker/matomo_tracker.dart'; import 'package:matomo_tracker/matomo_tracker.dart';
import 'package:package_info/package_info.dart'; import 'package:package_info/package_info.dart';
import 'package:posthog_session/posthog_session.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:aitrainer_app/model/exercise_type.dart'; import 'package:aitrainer_app/model/exercise_type.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -701,6 +702,8 @@ class Cache with Logging {
Track().track(TrackingEvent.enter); Track().track(TrackingEvent.enter);
MatomoTracker.instance.setVisitorUserId(customerId.toString()); MatomoTracker.instance.setVisitorUserId(customerId.toString());
MatomoTracker.instance.trackEvent(eventCategory: "wt", action: TrackingEvent.enter.enumToString()); MatomoTracker.instance.trackEvent(eventCategory: "wt", action: TrackingEvent.enter.enumToString());
Posthog().identify(userId: customerId.toString());
Posthog().capture(eventName: TrackingEvent.enter.enumToString());
} }
await Future.forEach(ActivityDone.values, (element) async { await Future.forEach(ActivityDone.values, (element) async {

View File

@ -5,7 +5,7 @@ import 'package:aitrainer_app/util/enums.dart';
import 'package:aitrainer_app/model/tracking.dart' as model; import 'package:aitrainer_app/model/tracking.dart' as model;
import 'package:firebase_analytics/firebase_analytics.dart'; import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:posthog_flutter/posthog_flutter.dart'; import 'package:posthog_session/posthog_session.dart';
import 'package:matomo_tracker/matomo_tracker.dart'; import 'package:matomo_tracker/matomo_tracker.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';

View File

@ -1099,13 +1099,15 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.5.0" version: "1.5.0"
posthog_flutter: posthog_session:
dependency: "direct main" dependency: "direct main"
description: description:
name: posthog_flutter path: "."
url: "https://pub.dartlang.org" ref: HEAD
source: hosted resolved-ref: "0db36d398cc23a7bfab09e0ddb6773525a92107b"
version: "2.0.3" url: "https://bossanyit@git.workouttest.org/bossanyit/posthog_session.git"
source: git
version: "0.0.1"
process: process:
dependency: transitive dependency: transitive
description: description:
@ -1770,5 +1772,5 @@ packages:
source: hosted source: hosted
version: "3.1.0" version: "3.1.0"
sdks: sdks:
dart: ">=2.17.0 <3.0.0" dart: ">=2.18.4 <3.0.0"
flutter: ">=3.0.0" flutter: ">=3.0.0"

View File

@ -15,10 +15,10 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.1.26+112 version: 1.1.27+115
environment: environment:
sdk: ">=2.12.0 <3.9.0" sdk: ">=2.18.4 <3.0.0"
dependencies: dependencies:
flutter: flutter:
@ -74,7 +74,7 @@ dependencies:
package_info: ^2.0.2 package_info: ^2.0.2
percent_indicator: ^4.0.0 percent_indicator: ^4.0.0
posthog_flutter: ^2.0.3 #posthog_flutter: ^2.0.3
purchases_flutter: ^3.9.5 purchases_flutter: ^3.9.5
rainbow_color: ^2.0.1 rainbow_color: ^2.0.1
@ -99,7 +99,8 @@ dependencies:
wakelock: ^0.6.2 wakelock: ^0.6.2
web_browser: ^0.5.0 web_browser: ^0.5.0
posthog_session:
git: https://bossanyit@git.workouttest.org/bossanyit/posthog_session.git
#fl_chart: ^0.50.0 #fl_chart: ^0.50.0
#location: ^3.2.4 #location: ^3.2.4
#flurry_data: ^0.0.1 #flurry_data: ^0.0.1