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.