Support » Plugin: All push notification for WP » Notification for post not work Custom notification work

  • Hi,
    I have a problem.

    Custom notification work correctly.

    But if I add new post or page notification not start. Settings are the same.

    Where I wrong?

    Thanks,
    Jacopo

Viewing 1 replies (of 1 total)
  • Closed!

    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 ‘Notification for post not work Custom notification work’ is closed to new replies.