OneSignal Api

development_aamir
Aamir Muhammad 2 years ago
parent bceae623ed
commit 364d1292a0

@ -230,4 +230,15 @@ class ChatApiClient {
} }
return response; return response;
} }
Future<Response> OneSignalVoip({required String deviceID}) async {
Response response = await ApiClient().postJsonForResponse(
"${ApiConsts.oneSignalCall}players",
{"app_id": ApiConsts.oneSignalAppID, "identifier": deviceID, "device_type": 0, "test_type": !kReleaseMode ? 0 : 1},
);
if (!kReleaseMode) {
print("res: " + response.body);
}
return response;
}
} }

@ -26,6 +26,9 @@ class ApiConsts {
static String chatMediaImageUploadUrl = chatServerBaseApiUrl + "shared/"; static String chatMediaImageUploadUrl = chatServerBaseApiUrl + "shared/";
static String chatFavUser = chatServerBaseApiUrl + "FavUser/"; static String chatFavUser = chatServerBaseApiUrl + "FavUser/";
static String chatUserImages = chatServerBaseUrl + "empservice/api/employee/"; static String chatUserImages = chatServerBaseUrl + "empservice/api/employee/";
static String oneSignalCall = "https://onesignal.com/api/v1/";
static String oneSignalAppID = "472e4582-5c44-47ab-a5f5-9369b8967107";
//Brain Marathon Constants //Brain Marathon Constants
static String marathonBaseUrl = "https://marathoon.com/service/api/"; static String marathonBaseUrl = "https://marathoon.com/service/api/";

@ -116,6 +116,7 @@ class _LoginScreenState extends State<LoginScreen> with WidgetsBindingObserver{
if (Platform.isIOS) { if (Platform.isIOS) {
voIPKit.getVoIPToken().then((value) { voIPKit.getVoIPToken().then((value) {
print('🎈 example: getVoIPToken: $value'); print('🎈 example: getVoIPToken: $value');
ChatApiClient().OneSignalVoip(deviceID: value!);
}); });
voIPKit.onDidUpdatePushToken = (String token) { voIPKit.onDidUpdatePushToken = (String token) {

@ -76,7 +76,7 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
: getOffersList[0].titleEn!.toText22(isBold: true, color: const Color(0xff2B353E)).center, : getOffersList[0].titleEn!.toText22(isBold: true, color: const Color(0xff2B353E)).center,
Html( Html(
data: AppState().isArabic(context) ? getOffersList[0].descriptionAr! : getOffersList[0].descriptionEn ?? "", data: AppState().isArabic(context) ? getOffersList[0].descriptionAr! : getOffersList[0].descriptionEn ?? "",
onLinkTap: (String? url, Map<String, String> attributes, _) { onLinkTap: (String? url, RenderContext context, Map<String, String> attributes, _) {
launchUrl(Uri.parse(url!)); launchUrl(Uri.parse(url!));
}, },
), ),

Loading…
Cancel
Save