Merge pull request #1834 from mpcomplete/rm.gcm
Remove gcm package from the repository.
This commit is contained in:
@@ -13,5 +13,3 @@ material-design-icons:
|
||||
- name: navigation/close
|
||||
- name: navigation/menu
|
||||
- name: navigation/more_vert
|
||||
services:
|
||||
- gcm
|
||||
|
||||
@@ -6,7 +6,6 @@ library fitness;
|
||||
|
||||
import 'package:playfair/playfair.dart' as playfair;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gcm/gcm.dart' as gcm;
|
||||
|
||||
import 'user_data.dart';
|
||||
import 'date_utils.dart';
|
||||
@@ -161,19 +160,6 @@ class FitnessAppState extends State<FitnessApp> {
|
||||
}
|
||||
}
|
||||
|
||||
initGcm() async {
|
||||
// Register for GCM messages using the senderId provided in the
|
||||
// google-services.json we received when registering our app.
|
||||
String token;
|
||||
token = await gcm.registerGcmService(
|
||||
"858790231562", (String from, String message) {
|
||||
print("onMessageReceived: $from; $message");
|
||||
gcm.unsubscribeTopics(token, ["global"]);
|
||||
});
|
||||
gcm.subscribeTopics(token, ["global"]);
|
||||
}
|
||||
|
||||
main() {
|
||||
initGcm();
|
||||
runApp(new FitnessApp());
|
||||
}
|
||||
|
||||
@@ -5,5 +5,3 @@ dependencies:
|
||||
path: ../../packages/flutter
|
||||
playfair:
|
||||
path: ../../packages/playfair
|
||||
gcm:
|
||||
path: ../../packages/gcm
|
||||
|
||||
7
packages/gcm/.gitignore
vendored
7
packages/gcm/.gitignore
vendored
@@ -1,7 +0,0 @@
|
||||
.DS_Store
|
||||
.idea
|
||||
.packages
|
||||
.pub/
|
||||
build/
|
||||
packages
|
||||
pubspec.lock
|
||||
@@ -1,10 +0,0 @@
|
||||
services:
|
||||
- name: gcm::GcmService
|
||||
android-class: org.domokit.gcm.RegistrationIntentService$MojoService
|
||||
jars:
|
||||
- android-sdk:extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar
|
||||
- android-sdk:extras/android/support/v13/android-support-v13.jar
|
||||
- android-sdk:extras/android/support/v7/appcompat/libs/android-support-v7-appcompat.jar
|
||||
- android-sdk:extras/android/support/v7/mediarouter/libs/android-support-v7-mediarouter.jar
|
||||
- https://storage.googleapis.com/mojo_infra/flutter/7bce54b79ef9ee57999cc8e258d664a88723d56d/android-arm/gcm/gcm_lib.dex.jar
|
||||
- https://storage.googleapis.com/mojo_infra/flutter/7bce54b79ef9ee57999cc8e258d664a88723d56d/android-arm/gcm/interfaces_java.dex.jar
|
||||
@@ -1,10 +0,0 @@
|
||||
// Copyright 2015 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
/// Service exposed to Flutter apps that implements a subset of the GCM API.
|
||||
///
|
||||
/// This library will probably be moved into a separate package eventually.
|
||||
library gcm;
|
||||
|
||||
export 'src/gcm.dart';
|
||||
@@ -1,43 +0,0 @@
|
||||
// Copyright 2015, the Flutter authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:sky_services/gcm/gcm.mojom.dart';
|
||||
|
||||
GcmServiceProxy _initGcmService() {
|
||||
GcmServiceProxy gcmService = new GcmServiceProxy.unbound();
|
||||
shell.connectToService(null, gcmService);
|
||||
return gcmService;
|
||||
}
|
||||
|
||||
final GcmServiceProxy _gcmService = _initGcmService();
|
||||
|
||||
typedef void GcmListenerCallback(String from, String message);
|
||||
class _GcmListenerImpl implements GcmListener {
|
||||
_GcmListenerImpl(this.callback);
|
||||
|
||||
GcmListenerCallback callback;
|
||||
|
||||
void onMessageReceived(String from, String message) {
|
||||
callback(from, message);
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> registerGcmService(String senderId, GcmListenerCallback listenerCallback) async {
|
||||
GcmListenerStub listener = new GcmListenerStub.unbound()
|
||||
..impl = new _GcmListenerImpl(listenerCallback);
|
||||
GcmServiceRegisterResponseParams result =
|
||||
await _gcmService.ptr.register(senderId, listener);
|
||||
return result.token;
|
||||
}
|
||||
|
||||
void subscribeTopics(String token, List<String> topics) {
|
||||
_gcmService.ptr.subscribeTopics(token, topics);
|
||||
}
|
||||
|
||||
void unsubscribeTopics(String token, List<String> topics) {
|
||||
_gcmService.ptr.unsubscribeTopics(token, topics);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
name: gcm
|
||||
description: Bindings for Google Cloud Messaging API
|
||||
version: 0.0.1
|
||||
author: Flutter Authors <flutter-dev@googlegroups.com>
|
||||
homepage: https://github.com/flutter/flutter/tree/master/packages/playfair
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
path: ../flutter
|
||||
|
||||
dev_dependencies:
|
||||
test: 0.12.6+1
|
||||
|
||||
environment:
|
||||
sdk: '>=1.12.0 <2.0.0'
|
||||
Reference in New Issue
Block a user