Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contact Registration upon Installation #30

Open
6 of 8 tasks
alee8599 opened this issue Oct 11, 2020 · 0 comments
Open
6 of 8 tasks

Contact Registration upon Installation #30

alee8599 opened this issue Oct 11, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@alee8599
Copy link
Collaborator

alee8599 commented Oct 11, 2020

Steps For Contact Registration on RapidPro

  • create a new branch from develop called contact-registration-install

  • Add firebase_messaging as a dependency in your pubspec.yaml file.

  • Perform Android integration for firebase_messaging plugin.

  • Import necessary dependencies into main.dart.

import 'dart:async';
import 'package:firebase_messaging/firebase_messaging.dart';
  • Instantiate firebase messaging to access the API methods such as getToken() etc.
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
  • Obtain a registration token that uniquely identifies the app instance by adding _firebaseMessaging.getToken() inside initState() of main.dart to ensure it's only obtained once when the app launches; save it in fcm_token variable.

  • To register contacts, POST to the following URL with the parameters urn, fcm_token and optionally name.

https://app.rapidpro.io/c/fcm/1dc76b95-1013-4c82-8b0f-c05600f0b18c/register
  • Visit contacts page to verify if the contact registration POST action above was successful(To access contacts you must be logged into RapirPro workspace):
https://app.rapidpro.io/contact/ 

References:
https://pub.dev/packages/firebase_messaging
https://pub.dev/packages/firebase_messaging/example

@alee8599 alee8599 added the enhancement New feature or request label Oct 11, 2020
@alee8599 alee8599 added this to the 1.0.1 milestone Oct 11, 2020
@alee8599 alee8599 self-assigned this Oct 11, 2020
@ericcbear ericcbear assigned alee8599 and ericcbear and unassigned alee8599 Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants