apple push notifications Distribution

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • apple push notifications Distribution

    guten tach,

    aktuell habe ich bereits meine App im AppStore.
    Ein weiteres Update soll folgen, welches Push Notifications unterstützt.
    ich kann über meinen Webspace via PHP eine Push Nachricht an mein Device schicken.

    Allerdings alles in der Sandbox und im Development Modus.
    Was muss ich jetzt machen, damit die Push auch im Distribution Modus laufen?


    So sieht es bei mir aktuell im Member Center aus:
    Bildschirmfoto 2016-04-15 um 18.03.05.png


    Bildschirmfoto 2016-04-15 um 18.03.22.png

    Bildschirmfoto 2016-04-15 um 18.03.45.png



    Bildschirmfoto 2016-04-15 um 18.04.16.png




    Ist das so schon in Ordnung?
    => Wenn nein, was genau muss ich noch machen ?
    => Wenn ja, wie kann ich Push Notifications im Distribution Modus testen, ohne dass ich das neue Update vorweg im App Store zur Verfügung stellen muss.

    Vielen Dank schon Mal :)
  • Das heiß ich laufe unterm Strich ins Feuer, wenn die App online ist, die Push nicht funktionieren, weil ich es nicht testen konnte ? oO

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von PetTus ()

  • nicht so schlimm :)

    schlimm ist allerdings mein nächstes Problem oO
    habe folgendes festgestellt:

    ich sende via php eine Notification ans Device.
    Es kommt aber auch Mal vor, das ein und die selbe Notification an zwei Geräte geht.

    So z.B.

    Quellcode

    1. $ctx = stream_context_create();
    2. stream_context_set_option($ctx, 'ssl', 'local_cert', 'xxx.pem');
    3. stream_context_set_option($ctx, 'ssl', 'passphrase', 'xxx');
    4. $deviceTokens = ["xxx","yyy"];
    5. // Open a connection to the APNS server
    6. $fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
    7. if (!$fp) { exit("Failed to connect: ".$err." ".$errstr." ". PHP_EOL); }
    8. for ($y = 0; $y < count($deviceTokens); $y++)
    9. {
    10. $body['aps'] = array('silentPush' => 0, 'alert' => 'Test', 'badge' => $badgeNumber, 'sound' => 'default');
    11. $payload = json_encode($body);
    12. $msg = chr(0) . pack('n', 32) . pack('H*', $deviceTokens[$y]) . pack('n', strlen($payload)) . $payload;
    13. $result = fwrite($fp, $msg, strlen($msg));
    14. if (!$result)
    15. {
    16. echo 'Message not delivered' . PHP_EOL.'<br />';
    17. }
    18. else
    19. {
    20. echo 'Message successfully delivered' . PHP_EOL.'<br />';
    21. }
    22. }
    Alles anzeigen

    Jetzt ist das Problem, wenn deviceToken xxx ungültig ist, wird die Verbindung gekappt und device Token yyy (welcher gültig ist) bekommt keine Notification mehr.
    Wie kann ich diese Situation lösen ? :/
  • PetTus schrieb:

    nicht so schlimm :)

    schlimm ist allerdings mein nächstes Problem oO
    habe folgendes festgestellt:

    ich sende via php eine Notification ans Device.
    Es kommt aber auch Mal vor, das ein und die selbe Notification an zwei Geräte geht.

    So z.B.

    Quellcode

    1. $ctx = stream_context_create();
    2. stream_context_set_option($ctx, 'ssl', 'local_cert', 'xxx.pem');
    3. stream_context_set_option($ctx, 'ssl', 'passphrase', 'xxx');
    4. $deviceTokens = ["xxx","yyy"];
    5. // Open a connection to the APNS server
    6. $fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
    7. if (!$fp) { exit("Failed to connect: ".$err." ".$errstr." ". PHP_EOL); }
    8. for ($y = 0; $y < count($deviceTokens); $y++)
    9. {
    10. $body['aps'] = array('silentPush' => 0, 'alert' => 'Test', 'badge' => $badgeNumber, 'sound' => 'default');
    11. $payload = json_encode($body);
    12. $msg = chr(0) . pack('n', 32) . pack('H*', $deviceTokens[$y]) . pack('n', strlen($payload)) . $payload;
    13. $result = fwrite($fp, $msg, strlen($msg));
    14. if (!$result)
    15. {
    16. echo 'Message not delivered' . PHP_EOL.'<br />';
    17. }
    18. else
    19. {
    20. echo 'Message successfully delivered' . PHP_EOL.'<br />';
    21. }
    22. }
    Alles anzeigen
    Jetzt ist das Problem, wenn deviceToken xxx ungültig ist, wird die Verbindung gekappt und device Token yyy (welcher gültig ist) bekommt keine Notification mehr.
    Wie kann ich diese Situation lösen ? :/
    Nur mal so ins Blaue geraten: Einfach für jedes Token separat eine Stream öffnen?
    Man kann alles schaffen. Man muss es nur wollen ;)
    www.regetskcob.github.io