hiennguyen92 / flutter_callkit_incoming

Flutter Callkit Incoming
https://pub.dev/packages/flutter_callkit_incoming
MIT License
160 stars 252 forks source link

not showing call in ios #463

Open Nazeer-Nageb opened 4 months ago

Nazeer-Nageb commented 4 months ago
    Not showing call in ios

Hello @hiennguyen92 I completed the VoIP setup, but it still does not work on iOS and I cannot receive the call. What could be the problem? After convert the file and getting the voip.pem file, where should I put it?

_Originally posted by @Nazeer-Nageb in https://github.com/hiennguyen92/flutter_callkit_incoming/issues/459#issuecomment-1968435676_

hiennguyen92 commented 4 months ago

curl -v \ -d '{"aps":{"alert":"Hien Nguyen Call"},"id":"44d915e1-5ff4-4bed-bf13-c423048ec97a","nameCaller":"Hien Nguyen","handle":"0123456789","isVideo":true}' \ -H "apns-topic: com.hiennv.testing.voip" \ -H "apns-push-type: voip" \ --http2 \ --cert VOIP.pem:'' \ https://api.development.push.apple.com/3/device/

to push a voip to the device.

umairmehar commented 4 months ago

Having the same issue, Followed all the steps from: https://pub.dev/packages/flutter_callkit_incoming And
https://github.com/hiennguyen92/flutter_callkit_incoming/blob/master/PUSHKIT.md But it is still not working on iOS.

I am using FCM to push a notification. Can someone here help generate a payload to be sent to FCM?

This is what I'm trying to do right now:

                          message: {
                token: options[:device_token],
                notification: {
                    title: options[:title],
                    body: options[:body]
                },
                data: options[:data] || {},
                android: {
                    notification: {
                        sound: "tadah.wav",
                        click_action: "FLUTTER_NOTIFICATION_CLICK",
                        channel_id: 'high_importance_channel'
                    }
                },
                apns: {
                    headers: {
                        "apns-push-type": "voip",
                        "apns-topic": "<app-bundle-id>.voip"
                    },
                    payload: {
                        aps: {
                            sound: "tadah.wav"
                        }
                    }
                }
            }
Nazeer-Nageb commented 4 months ago

@hiennguyen92 I'm sorry but I couldn't understand what I had to do to make it work Is there anything that can help me understand what I should do?

umairmehar commented 4 months ago

Having the same issue, Followed all the steps from: https://pub.dev/packages/flutter_callkit_incoming And https://github.com/hiennguyen92/flutter_callkit_incoming/blob/master/PUSHKIT.md But it is still not working on iOS.

I am using FCM to push a notification. Can someone here help generate a payload to be sent to FCM?

This is what I'm trying to do right now:

                          message: {
              token: options[:device_token],
              notification: {
                  title: options[:title],
                  body: options[:body]
              },
              data: options[:data] || {},
              android: {
                  notification: {
                      sound: "tadah.wav",
                      click_action: "FLUTTER_NOTIFICATION_CLICK",
                      channel_id: 'high_importance_channel'
                  }
              },
              apns: {
                  headers: {
                      "apns-push-type": "voip",
                      "apns-topic": "<app-bundle-id>.voip"
                  },
                  payload: {
                      aps: {
                          sound: "tadah.wav"
                      }
                  }
              }
          }

I was trying to use FCM to push the voip notifications (on IOS). After getting in touch with FCM support, I learned that it's not possible to use FCM to make voip calls for IOS. So have to make a separate call to https://api.development.push.apple.com:443.

Nazeer-Nageb commented 4 months ago

@umairmehar how to make aseparate call ? Is there a video or anything that helps me on this topic to be able to solve this problem

umairmehar commented 3 months ago

@Nazeer-Nageb You can make apn voip push call as below:

curl -v \ -d '{"aps":{"alert": "Hien Nguyen Call"}, "id": "44d915e1-5ff4-4bed-bf13-c423048ec97a", "nameCaller": "Hien Nguyen", "handle": "0123456789", "isVideo": true}' \ -H "apns-topic: com.hiennv.testing.voip" \ -H "apns-push-type: voip" \ --http2 \ --cert VOIP.pem:'<passphrase>' \ https://api.development.push.apple.com/3/device/<device token>

Make sure to: Change com.hiennv.testing.voip to your app bundle (Must add .voip at the end) Change <passphrase> to be the path to your .pem file. Change <device token> to your device's VoIP token.

Depending on your programming language/platform you can use this call as a reference.

Sahilkathir commented 1 month ago

@umairmehar @hiennguyen92
our backend is connected with Firebase so there is any way to call this curl from Flutter or Firebase ?

curl -v \ -d '{"aps":{"alert": "Hien Nguyen Call"}, "id": "44d915e1-5ff4-4bed-bf13-c423048ec97a", "nameCaller": "Hien Nguyen", "handle": "0123456789", "isVideo": true}' \ -H "apns-topic: com.hiennv.testing.voip" \ -H "apns-push-type: voip" \ --http2 \ --cert VOIP.pem:'<passphrase>' \ https://api.development.push.apple.com/3/device/<device token>