umeng_analytics_push 1.0.11

  • Readme
  • Changelog
  • Example
  • Installing
  • 70

Umeng Analytics&Push Flutter Plugins(umeng_analytics_push) pub package #

Usages #

Import #

pub package

dependencies:
  umeng_analytics_push: ^x.x.x #最新版本见上方

# Or import through Git (choose one, Git version may be updated more timely)

dependencies:
  umeng_analytics_push:
      git:
        url: https://github.com/zileyuan/umeng_analytics_push.git

Android settings (with Kotlin example) #

Create a custom FlutterApplication class as the startup class, if the push function is not needed, uemng_push_id is set to empty, If you do not need to customize Push click, set the last parameter to false

package com.demo.umeng.app

import io.flutter.app.FlutterApplication
import io.github.zileyuan.umeng_analytics_push.UmengAnalyticsPushFlutterAndroid

class MyFlutterApplication: FlutterApplication() {
    override fun onCreate() {
        super.onCreate();
        UmengAnalyticsPushFlutterAndroid.androidInit(this, "uemng_app_key", "default",
                false, "uemng_message_secret", false)
    }
}

Modify MainActivity, add Umeng settings

package com.demo.umeng.app

import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant
import io.github.zileyuan.umeng_analytics_push.UmengAnalyticsPushFlutterAndroid

class MainActivity: FlutterActivity() {
  override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
    GeneratedPluginRegistrant.registerWith(flutterEngine);
  }

  override fun onResume() {
    super.onResume()
    UmengAnalyticsPushFlutterAndroid.androidOnResume(this)
  }

  override fun onPause() {
    super.onPause()
    UmengAnalyticsPushFlutterAndroid.androidOnPause(this)
  }
}

Modify the AndroidManifest.xml file

<application
  android:name="com.demo.umeng.app.MyFlutterApplication">
</application>

IOS settings (with Swift example) #

Modify AppDelegate.swift file, If Push function is not needed then pushEnabled is set to false

import UIKit
import Flutter

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
    override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        GeneratedPluginRegistrant.register(with: self)
        UmengAnalyticsPushFlutterIos.iosInit(launchOptions, appkey:"uemng_app_key", channel:"appstore", logEnabled:false, pushEnabled:true);
        return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    }

    // If you need to handle custom Push clicks, use the following code
    @available(iOS 10.0, *)
    override func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
        let userInfo = response.notification.request.content.userInfo
        UmengAnalyticsPushFlutterIos.handleCustomMessagePush(userInfo)
        completionHandler()
    }
}

Modify Runner-Bridging-Header.h file

#import "GeneratedPluginRegistrant.h"
#import <UMCommon/UMCommon.h>
#import <UMAnalytics/MobClick.h>
#import <UMPush/UMessage.h>
#import <UserNotifications/UserNotifications.h>
#import <umeng_analytics_push/UmengAnalyticsPushIos.h>

Use in Flutter #

Operation Alias

import 'package:umeng_analytics_push/umeng_analytics_push.dart';

UmengAnalyticsPush.addAlias('1001', 'jobcode');
UmengAnalyticsPush.setAlias('1002', 'jobcode');
UmengAnalyticsPush.deleteAlias('1002', 'jobcode');

Operation Tags

import 'package:umeng_analytics_push/umeng_analytics_push.dart';

UmengAnalyticsPush.addTags('manager');
UmengAnalyticsPush.deleteTags('manager');

Page buried point operation

import 'package:umeng_analytics_push/umeng_analytics_push.dart';

UmengAnalyticsPush.pageStart('memberPage');
UmengAnalyticsPush.pageEnd('memberPage');

Custom event

import 'package:umeng_analytics_push/umeng_analytics_push.dart';

UmengAnalyticsPush.event('customEvent', '1000');

Custom click Push response(Turn on the switch when initialization is required)

import 'package:umeng_analytics_push/umeng_analytics_push.dart';

UmengAnalyticsPush.addPushCustomMessageCallback((custom) {
  print(custom);
});

1.0.11 #

  • Solve the problem that the new version SDK of Umeng does not match each other
  • 解决友盟新版本SDK相互不匹配的问题

1.0.10 #

  • Solve the problem that the new version SDK of Umeng does not match each other
  • 解决友盟新版本SDK相互不匹配的问题

1.0.9 #

  • Solve the new version SDK compilation error of Umeng
  • 解决友盟新版本SDK编译错误

1.0.8 #

  • Update the SDK version that Umeng depends on
  • 更新友盟依赖的SDK版本

1.0.7 #

  • Update the document, some nouns are consistent with Umeng
  • 更新文档,一些名词和友盟一致
  • Corrected the userNotificationCenter writing of the custom response message IOS, thanks gaoyong06
  • 修正自定义响应消息IOS的userNotificationCenter写法,感谢gaoyong06

1.0.6 #

  • Add page buried point events (startPage, endPage)
  • 增加页面埋点事件(startPage,endPage)
  • Add custom event (event)
  • 增加自定义事件(event)
  • Add Push custom response
  • 增加Push的自定义响应

1.0.5 #

  • adjustment description
  • 调整说明

1.0.4 #

  • adjustment description
  • 调整说明

1.0.3 #

  • fix bugs
  • 修复错误

1.0.2 #

  • Document update
  • 文档更新

1.0.1 #

  • Plug-in mode compatible with Flutter1.12
  • 兼容Flutter1.12后的插件模式

1.0.0 #

  • Integration of basic Umeng Analytics functions
  • 集成基本的Umeng的Analytics分析功能
  • Integrated basic Umeng Push function (support Alias, Tags function)
  • 集成基本的Umeng的Push推送功能(支持别名Alias,标签Tags功能)

example/lib/main.dart

import 'package:flutter/material.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  umeng_analytics_push: ^1.0.11

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:umeng_analytics_push/umeng_analytics_push.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
41
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

We analyzed this package on Jul 7, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:umeng_analytics_push/umeng_analytics_push.dart] that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because of import path [package:umeng_analytics_push/umeng_analytics_push.dart] that declares support for platforms: android, ios

Package does not support Flutter platform web

Because of import path [package:umeng_analytics_push/umeng_analytics_push.dart] that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because of import path [package:umeng_analytics_push/umeng_analytics_push.dart] that declares support for platforms: android, ios

Package not compatible with SDK dart

because of import path [umeng_analytics_push] that is in a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test