|
|
@@ -1,41 +0,0 @@
|
|
|
-import 'package:flutter/material.dart';
|
|
|
-import 'package:jpush_flutter/jpush_flutter.dart';
|
|
|
-
|
|
|
-class SplashPage extends StatefulWidget {
|
|
|
- @override
|
|
|
- SplashPageState createState() => SplashPageState();
|
|
|
-}
|
|
|
-
|
|
|
-class SplashPageState extends State<SplashPage> {
|
|
|
- JPush jPush = new JPush();
|
|
|
- String registerId;
|
|
|
- _startupJpush() {
|
|
|
- jPush.setup(
|
|
|
- appKey: "59c5293593306ecb18120462",
|
|
|
- channel: "developer-default",
|
|
|
- debug: true);
|
|
|
- }
|
|
|
-
|
|
|
- _getRegisterID() async {
|
|
|
- registerId = await jPush.getRegistrationID();
|
|
|
- print('*********registerid=' + registerId);
|
|
|
- return registerId;
|
|
|
- }
|
|
|
-
|
|
|
- _setPushTag() {
|
|
|
- List<String> tags = List<String>();
|
|
|
- tags.add("jason");
|
|
|
- jPush.setTags(tags);
|
|
|
- }
|
|
|
-
|
|
|
- _addEventHandler() {
|
|
|
- jPush.addEventHandler(onReceiveNotification: (Map<String, dynamic> event) {
|
|
|
- print('*********addOnreceive>>>>>>$event');//进程运行时候可以接受
|
|
|
- var title = event['alert'];
|
|
|
- // var extra = json.decode(event['extras']['cn.jpush.android.EXTRA']);
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
- @override
|
|
|
- Widget build(BuildContext context) {}
|
|
|
-}
|