Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ios not receiving notifications #49

Closed
ShVitaliy opened this issue May 14, 2017 · 5 comments
Closed

Ios not receiving notifications #49

ShVitaliy opened this issue May 14, 2017 · 5 comments

Comments

@ShVitaliy
Copy link

Working fine with android, but doesn't work with ios. Tried set priority to high and content_available to true. No effect. In the same time, it works fine when I'm sending notification via firebase console or curl (both from php or linux console). Can you help me? Is it bug or I'm doing smth wrong? I tried the example from documentation (downstream Messages)

@ShVitaliy
Copy link
Author

Sorry it was my fault, mistake in logic. Library works fine both in android and ios

@Abdulhmid
Copy link

Abdulhmid commented May 7, 2018

can you share your code send push notif to IOS platform,
i have follow instruction from documentation, and after i log downStreamResponse, i'm get response succes, but on my IOS developer say not received Push Notif has i'm send,
thanks before

@keyurgwebplanex
Copy link

I faced the same problem.
Can you please tell me how to send notifications in IOS?

@ShVitaliy
Copy link
Author

ShVitaliy commented Jun 17, 2019

unfortunatly, i haven't the source code of that project already. but, as i told before, the code was the same, as for android.

if you faced with troubles, you can easily send messages via curl, or write your own wrapper around it.
if you didn't tried yet, the simpliest curl code example is so:

`
$url = 'https://fcm.googleapis.com/fcm/send';

            $fields = [
            'registration_ids' => [
                $this->push_token
            ],
            'notification' => ['body' => $message, 'title' => $title, 'sound' => $sound, 'badge' => $badge],
            'priority' => 10
        ];
        $fields = json_encode ( $fields );
        $headers = [
            'Authorization: key=' . env('FCM_SERVER_KEY'),
            'Content-Type: application/json'
        ];

        $ch = curl_init();
        curl_setopt( $ch, CURLOPT_URL, $url );
        curl_setopt( $ch, CURLOPT_POST, true );
        curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers );
        curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
        curl_setopt( $ch, CURLOPT_POSTFIELDS, $fields );

        $out = curl_exec( $ch );
        curl_close( $ch );
        Log::info('FCM answer: ' . $out);

`
library examples you can find in documentation. Hope, it will help

@tamirkonor
Copy link

Is the library working for ios >11
the server is using the library and push arrives on Android, not on ios when sending from the fcm console the push arrives.
the apps are in ionic but again it is received when sent from the fcm console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants