diff --git a/Examples/simple-fcm-client/app/FirebaseClient.js b/Examples/simple-fcm-client/app/FirebaseClient.js index 3ba9a54f502bdf900a1bc2d2e57deebbb098d2a2..1eb3722fc071de2a760f9c161b18cb17c937dbcb 100644 --- a/Examples/simple-fcm-client/app/FirebaseClient.js +++ b/Examples/simple-fcm-client/app/FirebaseClient.js @@ -83,11 +83,15 @@ class FirebaseClient { try { let response = await fetch(API_URL, { method: "POST", headers, body }); - response = await response.json(); - if(!response.success){ + console.log(response); + try{ + response = await response.json(); + if(!response.success){ + Alert.alert('Failed to send notification, check error log') + } + } catch (err){ Alert.alert('Failed to send notification, check error log') } - console.log(response); } catch (err) { Alert.alert(err && err.message) }