Closed nathanbaleeta closed 4 years ago
Steps For Contact Registration on RapidPro
[ ] 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
https://app.rapidpro.io/contact/
References: https://pub.dev/packages/firebase_messaging https://pub.dev/packages/firebase_messaging/example
[ ] create a separate folder for user registration
[ ] create widget landing page for user registration
[ ] create two routes:
User Login: limit to a phone-number static field
User Registration: limit to name and phone number static field
reference: https://www.tutorialkart.com/flutter/flutter-login-screen/
reference: https://flutter.dev/docs/cookbook/navigation/navigation-basics
figma: https://www.figma.com/file/XDPfCxrYiVULaEaVBzXDih/UNICEF-U-Report-Stanford-Team?node-id=0%3A1
[ ] pull data from fields
[ ] get contact information and uuid of device from rapid-pro GET request
[ ] update contact information in Rapid-Pro by posting data from fields by using post and specific uuid
reference: https://rapidpro.io/api/v2/contacts
[ ] change static fields to text input fields
reference: https://flutter.dev/docs/cookbook/forms/retrieve-input
If you want to join U-Report Global as well as a specific country on the mobile app you will be required to register and provide some information prior to getting involved in polls. Registration is one of the core features expected to be shipped as part of the MVP. This process involves interacting with RapidPro API.
@alee8599 and @ericcbear could you kindly do research and document the steps involved during the registration process and highlight the technical actions you will have to follow to assist with creating a road map for the development team to follow. Simple bullets in the comment box below will suffice without requiring any diagrams.
Hint: