Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support newer android versions #6

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f9216c5
atualizado versão do gradle no distributionUrl
coderenan Oct 2, 2024
9ace899
atualizado compileSdkVersion para 34 e minSdkVersion 21
coderenan Oct 2, 2024
79197af
atualizado build:gradle:7.2.1 para build:gradle:7.4.0
coderenan Oct 2, 2024
3dd3acd
compileSdkVersion 34, targetSdkVersion 34 e minSdkVersion 21
coderenan Oct 2, 2024
0faee7f
atualizado import do sdk
coderenan Oct 2, 2024
1d0e74d
implementado fvm para testes
coderenan Oct 2, 2024
22847fb
update pubspec
coderenan Oct 2, 2024
126a4c5
atualizado build gradle version e adicionado namespace
coderenan Oct 2, 2024
dbe30d4
Merge branch 'feature/fix-android-builds' into develop
coderenan Oct 2, 2024
4d88cab
Merge branch 'release/release_1'
coderenan Oct 2, 2024
a328443
substituicao do setMockMethodCallHandler
coderenan Oct 3, 2024
3021446
Alterado SegmentWeb, corrigindo avisos de uso de dynamic no método ha…
coderenan Oct 3, 2024
8d842d3
update flutter/dart sdk version
coderenan Oct 3, 2024
3cc35c4
update dependencia meta para 1.12.0
coderenan Oct 3, 2024
1fa8d3e
susbtituido flutter_segment_example para flutter_segment_analytics_ex…
coderenan Oct 3, 2024
7e3e548
atualizado MethodChannels de flutter_segment para flutter_segment_ana…
coderenan Oct 3, 2024
827321a
atualizado path de import/export
coderenan Oct 3, 2024
0320139
atualizado readmes
coderenan Oct 3, 2024
c94755d
atualizado package com.example.flutter_segment para package com.examp…
coderenan Oct 3, 2024
c097150
ajustado importacao de dependencias
coderenan Oct 3, 2024
6d0cde5
package renomeado
coderenan Oct 3, 2024
c55a8ce
Merge branch 'feature/buildfixes' into develop
coderenan Oct 3, 2024
a3a05ed
Merge branch 'release/merge_main_v2'
coderenan Oct 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Segment plugin
[![Pub Version](https://img.shields.io/pub/v/flutter_segment)](https://pub.dev/packages/flutter_segment_sdk)
[![Pub Version](https://img.shields.io/pub/v/flutter_segment)](https://pub.dev/packages/flutter_segment_analytics)
[![style: lint](https://img.shields.io/badge/style-lint-4BC0F5.svg)](https://pub.dev/packages/lint)

This library was originally created by [claimsforce-gmbh](https://github.com/claimsforce-gmbh) and then maintained by [la-haus](https://github.com/la-haus). We are extremely grateful for the work they have done building and maintaining this package.
Expand All @@ -11,7 +11,7 @@ We want to prepare flutter-segment for the future!
Please have a look at [this issue](https://github.com/claimsforce-gmbh/flutter-segment/issues/46) and let us know what you think.

## Usage
To use this plugin, add `flutter_segment` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).
To use this plugin, add `flutter_segment_analytics` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).

### Important note for iOS usage
Since version `3.5.0` we are forcing all users to use `use_frameworks!` within the [`Podfile`](https://github.com/claimsforce-gmbh/flutter-segment/blob/master/example/ios/Podfile#L31) due to import issues of some 3rd party dependencies.
Expand All @@ -37,7 +37,7 @@ Since version `3.5.0` we are forcing all users to use `use_frameworks!` within t
### Example
``` dart
import 'package:flutter/material.dart';
import 'package:flutter_segment/flutter_segment.dart';
import 'package:flutter_segment_analytics/flutter_segment.dart';

void main() => runApp(MyApp());

Expand Down Expand Up @@ -115,7 +115,7 @@ void main() {

### Android _(Deprecated*)_
```xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.flutter_segment_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.flutter_segment_analytics_example">
<application>
<activity>
[...]
Expand Down
9 changes: 5 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
group 'com.example.flutter_segment'
group 'com.example.flutter_segment_analytics'
version '3.12.1'

buildscript {
Expand All @@ -9,7 +9,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.android.tools.build:gradle:7.4.0'
}
}

Expand All @@ -23,10 +23,11 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
compileSdkVersion 31
namespace 'com.example.flutter_segment_analytics'
compileSdkVersion 34

defaultConfig {
minSdkVersion 16
minSdkVersion 21
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
lintOptions {
Expand Down
4 changes: 3 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xms1024m -Xmx4096m
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'flutter_segment'
rootProject.name = 'flutter_segment_analytics'
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutter_segment">
package="com.example.flutter_segment_analytics">
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.flutter_segment;
package com.example.flutter_segment_analytics;

import android.os.Bundle;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.flutter_segment;
package com.example.flutter_segment_analytics;

import android.content.Context;
import android.content.pm.ApplicationInfo;
Expand Down Expand Up @@ -45,7 +45,7 @@ public void onAttachedToEngine(FlutterPluginBinding binding) {
private void setupChannels(Context applicationContext, BinaryMessenger messenger) {
this.applicationContext = applicationContext;

methodChannel = new MethodChannel(messenger, "flutter_segment");
methodChannel = new MethodChannel(messenger, "flutter_segment_analytics");
// register the channel to receive calls
methodChannel.setMethodCallHandler(this);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.flutter_segment;
package com.example.flutter_segment_analytics;

import androidx.annotation.VisibleForTesting;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.flutter_segment;
package com.example.flutter_segment_analytics;

import com.segment.analytics.Properties;

Expand Down
3 changes: 3 additions & 0 deletions example/.fvm/fvm_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutterSdkVersion": "3.24.3"
}
1 change: 1 addition & 0 deletions example/.fvm/release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.24.3
1 change: 1 addition & 0 deletions example/.fvm/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.24.3
3 changes: 3 additions & 0 deletions example/.fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "3.24.3"
}
2 changes: 1 addition & 1 deletion example/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# flutter_segment_example

Demonstrates how to use the flutter_segment plugin.
Demonstrates how to use the flutter_segment_analytics plugin.

## Getting Started

Expand Down
8 changes: 4 additions & 4 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 31
compileSdkVersion 34

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.flutter_segment_example"
minSdkVersion 16
targetSdkVersion 31
applicationId "com.example.flutter_segment_analytics_example"
minSdkVersion 21
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutter_segment_example">
package="com.example.flutter_segment_analytics_example">

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.flutter_segment_example;
package com.example.flutter_segment_analytics_example;

import io.flutter.embedding.android.FlutterActivity;

Expand Down
2 changes: 1 addition & 1 deletion example/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutter_segment_example">
package="com.example.flutter_segment_analytics_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
4 changes: 2 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.android.tools.build:gradle:7.4.0'
}
}

Expand All @@ -24,6 +24,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_segment/flutter_segment.dart';
import 'package:flutter_segment_analytics/flutter_segment.dart';

void main() async {
/// Wait until the platform channel is properly initialized so we can call
Expand Down
62 changes: 43 additions & 19 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ packages:
dependency: "direct main"
description:
name: cupertino_icons
sha256: "486b7bc707424572cdf7bd7e812a0c146de3fd47ecadf070254cc60383f21dd8"
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
url: "https://pub.dev"
source: hosted
version: "1.0.3"
version: "1.0.8"
fake_async:
dependency: transitive
description:
Expand All @@ -62,7 +62,7 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_segment_sdk:
flutter_segment_analytics:
dependency: "direct main"
description:
path: ".."
Expand All @@ -79,38 +79,62 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
matcher:
dependency: transitive
description:
name: matcher
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev"
source: hosted
version: "0.12.16"
version: "0.12.16+1"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
version: "0.8.0"
meta:
dependency: transitive
description:
name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.12.0"
path:
dependency: transitive
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.8.3"
version: "1.9.0"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -160,10 +184,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.7.0"
vector_math:
dependency: transitive
description:
Expand All @@ -172,14 +196,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
web:
vm_service:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "0.3.0"
version: "14.2.1"
sdks:
dart: ">=3.2.0-194.0.dev <4.0.0"
flutter: ">=1.12.13+hotfix.4"
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: flutter_segment_example
description: Demonstrates how to use the flutter_segment plugin.
description: Demonstrates how to use the flutter_segment_analytics plugin.
publish_to: 'none'

version: 0.0.1+1
Expand All @@ -13,7 +13,7 @@ dependencies:
cupertino_icons: ^1.0.3
flutter:
sdk: flutter
flutter_segment_sdk:
flutter_segment_analytics:
path: ../

dev_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/FlutterSegmentPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ @implementation FlutterSegmentPlugin

+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
FlutterMethodChannel* channel = [FlutterMethodChannel
methodChannelWithName:@"flutter_segment"
methodChannelWithName:@"flutter_segment_analytics"
binaryMessenger:[registrar messenger]];
FlutterSegmentPlugin* instance = [[FlutterSegmentPlugin alloc] init];

Expand Down
2 changes: 1 addition & 1 deletion ios/flutter_segment.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'flutter_segment'
s.name = 'flutter_segment_analytics'
s.version = '3.13.1'
s.summary = 'Segment.io plugin for Flutter'
s.description = <<-DESC
Expand Down
6 changes: 3 additions & 3 deletions lib/flutter_segment.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export 'package:flutter_segment_sdk/src/segment.dart';
export 'package:flutter_segment_sdk/src/segment_config.dart';
export 'package:flutter_segment_sdk/src/segment_observer.dart';
export 'package:flutter_segment_analytics/src/segment.dart';
export 'package:flutter_segment_analytics/src/segment_config.dart';
export 'package:flutter_segment_analytics/src/segment_observer.dart';
2 changes: 1 addition & 1 deletion lib/segment_web.dart
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export 'package:flutter_segment_sdk/src/segment_web.dart';
export 'package:flutter_segment_analytics/src/segment_web.dart';
Loading