• Push Notifications Data Showing in website. But notification message not coming in Mobile. I am using FCM.In mobile application added register API also.

Viewing 1 replies (of 1 total)
  • If you have problem on iOS notification:

    Change this file: wp-content/plugins/all-push-notification/pushnotification/class-pushnotification-ios.php

    with this:
    foreach ($devices as $device) {
    error_log(“device:”.$device);
    // Build the binary notification
    $msg = chr(0) . pack(‘n’, 32) . pack(‘H*’, $device) . pack(‘n’, strlen($payload)) . $payload;

    //Send it to the server
    $results[] = fwrite($fp, $msg, strlen($msg));
    if(!$result){
    fclose($fp);
    sleep(2);
    if($send_via_production==”yes”){
    $fp = stream_socket_client(‘ssl://gateway.push.apple.com:2195’,$err,$errstr,60,STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT,$ctx);
    }else{
    $fp = stream_socket_client(‘ssl://gateway.sandbox.push.apple.com:2195’,$err,$errstr,60,STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
    }
    }else{
    //Insert msgs into pushnotification log table
    global $wpdb;
    $blogtime = current_time( ‘mysql’ );
    $all_pushnotification_logs = $wpdb->prefix . ‘all_pushnotification_logs’;
    $wpdb->insert($all_pushnotification_logs,array(‘push_title’ => $msg_title,’push_message’ => $message_text,’push_sent’ => 1,’push_send_date’ => $blogtime,’devicetoken_id’ =>$device),array(‘%s’,’%s’,’%d’,’%s’,’%s’));
    }
    }

Viewing 1 replies (of 1 total)
  • The topic ‘Push Notifications Data Showing in website. But notification message not coming’ is closed to new replies.