diff --git a/lib/constants.dart b/lib/constants.dart new file mode 100644 index 0000000..b988060 --- /dev/null +++ b/lib/constants.dart @@ -0,0 +1 @@ +final bool debugRelease = true; diff --git a/lib/networking/api_client.dart b/lib/networking/api_client.dart index 3dbd92e..4a73023 100644 --- a/lib/networking/api_client.dart +++ b/lib/networking/api_client.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:convert'; import 'package:http/http.dart' as http; +import 'package:selftrackingapp/constants.dart'; import 'package:selftrackingapp/models/news_article.dart'; import 'package:selftrackingapp/models/reported_case.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -13,8 +14,6 @@ class ApiClient { // final String _baseUrl = 'https://api.covid-19.health.gov.lk'; final String _baseUrl; - static final bool debugRelease = true; - ApiClient() : _baseUrl = debugRelease ? 'http://covid19.egreen.io:8000' diff --git a/lib/page/screen/root_screen.dart b/lib/page/screen/root_screen.dart index 0111dd0..c1db605 100644 --- a/lib/page/screen/root_screen.dart +++ b/lib/page/screen/root_screen.dart @@ -2,6 +2,7 @@ import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/material.dart'; import 'package:package_info/package_info.dart'; import 'package:provider/provider.dart'; +import 'package:selftrackingapp/constants.dart'; import 'package:selftrackingapp/models/news_article.dart'; import 'package:selftrackingapp/networking/api_client.dart'; import 'package:selftrackingapp/notifiers/registered_cases_model.dart'; @@ -46,7 +47,8 @@ class _RootScreenState extends State { void initState() { super.initState(); _configureFCM(); - _messaging.subscribeToTopic("mobile_message"); + _messaging.subscribeToTopic( + debugRelease ? "mobile_message_test" : "mobile_message"); PackageInfo.fromPlatform().then((PackageInfo packageInfo) { var name = packageInfo.appName;