tree: f615acef2b41d4f2d166ee20c8d7ef998516f335 [path history] [tgz]
  1. examples/
  2. packages/
  3. src/
  4. BUILD.gn
  5. CONTRIBUTING.md
  6. gcm.mojom
  7. LICENSE
  8. README.md
README.md

flutter_gcm

A Flutter service for Cloud Messaging.

Running the sample app.

  1. The package assumes you have this directory structure (each bullet is a sibling):
  1. Ensure your environment is set up for building Flutter apps as described here.
  2. Follow these steps:
cd engine/src/third_party/gcm/examples/simple
flutter start

Using GCM in your own Flutter app.

  1. Add the following snippet to your app's pubspec.yaml:
dependencies:
  gcm:
    path: path/to/flutter_gcm/packages/gcm
  1. Add the following snippet to your app's flutter.yaml:
services:
  - gcm
  1. Register GCM in your .dart code using the sender ID provided here:
  String token = await gcm.registerGcmService(SENDER_ID, onMessageReceived);
  gcm.subscribeTopics(token, ['global']);

See gcm.mojom for the full API.

Building new .jar or .dylib files

See CONTRIBUTING.md.