Skip to content

Commit

Permalink
prepare release 0.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
formatCvt committed Feb 16, 2021
1 parent 5d3921a commit 089e5b9
Show file tree
Hide file tree
Showing 94 changed files with 398 additions and 761 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .metadata
100644 → 100755
Empty file.
5 changes: 5 additions & 0 deletions CHANGELOG.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.0.6

* Upgrade AppMetrica SDK (Android 3.18.0/iOS 3.14.0).
* Upgrade Android plugin.

## 0.0.5+2

* Upgrade AppMetrica SDK (Android 3.14.3/iOS 3.11.1).
Expand Down
Empty file modified CONTRIBUTING.md
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
195 changes: 0 additions & 195 deletions analysis_options.yaml

This file was deleted.

Empty file modified android/.gitignore
100644 → 100755
Empty file.
7 changes: 3 additions & 4 deletions android/build.gradle
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'com.emallstudio.appmetrica_sdk'
version '1.0-SNAPSHOT'
version '1.0'

buildscript {
repositories {
Expand All @@ -8,7 +8,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.android.tools.build:gradle:3.5.0'
}
}

Expand All @@ -26,7 +26,6 @@ android {

defaultConfig {
minSdkVersion 16
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
disable 'InvalidPackage'
Expand All @@ -35,5 +34,5 @@ android {

dependencies {
// AppMetrica SDK.
implementation 'com.yandex.android:mobmetricalib:3.14.3'
implementation 'com.yandex.android:mobmetricalib:3.18.0'
}
Empty file modified android/gradle.properties
100644 → 100755
Empty file.
5 changes: 5 additions & 0 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
Empty file modified android/settings.gradle
100644 → 100755
Empty file.
Empty file modified android/src/main/AndroidManifest.xml
100644 → 100755
Empty file.
46 changes: 33 additions & 13 deletions android/src/main/java/com/emallstudio/appmetrica_sdk/AppmetricaSdkPlugin.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

package com.emallstudio.appmetrica_sdk;

import androidx.annotation.NonNull;

import android.util.Log;
import android.app.Activity;
import android.app.Application;
Expand All @@ -13,6 +15,8 @@
import android.util.SparseArray;
import java.util.Map;

import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
Expand All @@ -28,24 +32,40 @@
import com.yandex.metrica.profile.UserProfileUpdate;

/** AppmetricaSdkPlugin */
public class AppmetricaSdkPlugin implements MethodCallHandler {
public class AppmetricaSdkPlugin implements MethodCallHandler, FlutterPlugin {
private static final String TAG = "AppmetricaSdkPlugin";
private Context mContext;
private Application mApplication;
private MethodChannel methodChannel;
private Context context;
private Application application;

/** Plugin registration. */
/** Plugin registration for v1 embedder. */
public static void registerWith(Registrar registrar) {
final MethodChannel channel = new MethodChannel(registrar.messenger(), "emallstudio.com/appmetrica_sdk");
channel.setMethodCallHandler(new AppmetricaSdkPlugin(registrar));
final AppmetricaSdkPlugin instance = new AppmetricaSdkPlugin();
instance.onAttachedToEngine(registrar.context(), registrar.messenger());
}

@Override
public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
onAttachedToEngine(flutterPluginBinding.getApplicationContext(), flutterPluginBinding.getBinaryMessenger());
}

private AppmetricaSdkPlugin(Registrar registrar) {
this.mContext = registrar.activity().getApplicationContext();
this.mApplication = registrar.activity().getApplication();
private void onAttachedToEngine(Context applicationContext, BinaryMessenger binaryMessenger) {
application = (Application) applicationContext;
context = applicationContext;
methodChannel = new MethodChannel(binaryMessenger, "emallstudio.com/appmetrica_sdk");
methodChannel.setMethodCallHandler(this);
}

@Override
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
methodChannel.setMethodCallHandler(null);
methodChannel = null;
context = null;
application = null;
}

@Override
public void onMethodCall(MethodCall call, Result result) {
public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
switch (call.method) {
case "activate":
handleActivate(call, result);
Expand Down Expand Up @@ -113,9 +133,9 @@ private void handleActivate(MethodCall call, Result result) {
.withMaxReportsInDatabaseCount(maxReportsInDatabaseCount)
.build();
// Initializing the AppMetrica SDK.
YandexMetrica.activate(mContext, config);
YandexMetrica.activate(context, config);
// Automatic tracking of user activity.
YandexMetrica.enableActivityAutoTracking(mApplication);
YandexMetrica.enableActivityAutoTracking(application);
} catch (Exception e) {
Log.e(TAG, e.getMessage(), e);
result.error("Error performing activation", e.getMessage(), null);
Expand Down Expand Up @@ -269,7 +289,7 @@ private void handleSetStatisticsSending(MethodCall call, Result result) {
@SuppressWarnings("unchecked")
Map<String, Object> arguments = (Map<String, Object>) call.arguments;
final boolean statisticsSending = (boolean) arguments.get("statisticsSending");
YandexMetrica.setStatisticsSending(mContext, statisticsSending);
YandexMetrica.setStatisticsSending(context, statisticsSending);
} catch (Exception e) {
Log.e(TAG, e.getMessage(), e);
result.error("Error enable sending statistics", e.getMessage(), null);
Expand Down
Empty file modified circle.yml
100644 → 100755
Empty file.
51 changes: 8 additions & 43 deletions example/.gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,55 +22,20 @@

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
# Web related
lib/generated_plugin_registrant.dart

# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*
# Symbolication related
app.*.symbols

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

ios/Flutter/flutter_export_environment.sh

ios/Flutter/Flutter.podspec
# Obfuscation related
app.*.map.json
Loading

0 comments on commit 089e5b9

Please sign in to comment.