I am using FCM with APNS to send Push notifications to my iOS app. I am getting notifications in all modes (foreground, background and dismissed) when app is deployed from Xcode (Xcode version 12.4, iOS version : 14.4). However, issue is when app is downloaded from the Store, I am able to receive the push in foreground but not when app gets dismissed.
Here’s what I am doing :
Here's my payload info :
let mesg = {
registration_ids: iosIds,
data: {
commentId: commentId,
userId: userid,
comment: comment,
projectId: projectId,
projectName: projectName,
commentType: commentType.toString(),
userName: userName,
type: '1'
},
apns: {
headers: {
"apns-priority": 5,
},
payload: {
aps: {
"content-available": 1,
alert: ""
}
}
},
content_available: true,
priority: 'high',
"apns-priority": 5,
}
let option = {
method: 'POST',
url: 'https:///fcm/send',
headers: {
'Content-Type': 'application/json',
'Authorization': 'key=' + functions.config().auth.key
},
body: JSON.stringify(mesg)
}
Please can anyone assist me regarding the same.
Here’s what I am doing :
I have changed the key value for aps environment to production in the entitlements file
All the process to configure push notifications such as adding capabilities for push notifications and configuring them in app delegate along with firebase configuration is done
Whenever push is received, I am showing local notifications to the user.
Here's my payload info :
let mesg = {
registration_ids: iosIds,
data: {
commentId: commentId,
userId: userid,
comment: comment,
projectId: projectId,
projectName: projectName,
commentType: commentType.toString(),
userName: userName,
type: '1'
},
apns: {
headers: {
"apns-priority": 5,
},
payload: {
aps: {
"content-available": 1,
alert: ""
}
}
},
content_available: true,
priority: 'high',
"apns-priority": 5,
}
let option = {
method: 'POST',
url: 'https:///fcm/send',
headers: {
'Content-Type': 'application/json',
'Authorization': 'key=' + functions.config().auth.key
},
body: JSON.stringify(mesg)
}
Please can anyone assist me regarding the same.