Ad Hoc build not registering push notifications
I have an application which I would like to enable push notifications on. I have had it working with my developer build and then I wanted to make an ad hoc build.
I installed the Ad Hoc build on my iPhone and it is working fine. Then I tried an iPhone in the family but it does not register for push notifications. The application is not showed in settings (where settings for push notifications are made), there is no alert asking the user to activate push notifications on the first launch and the device is not registered in my MySQL database.
I am using the PHP library "Easy APNs" and it should b开发者_StackOverflow中文版e set to use both development and production certificates - anyways, I don't think that's where the issue is as there are no actions from to phone to try to register for push notifications.
Does anyone have an idea what I can be doing wrong?
EDIT: PHP script for sending push notifications to all registered devices with Easy APNs.
// GET ALL DEVICES
$result = $db->query("SELECT pid FROM apns_devices WHERE status = 'active'");
$pids = array();
while($row = $result->fetch_array(MYSQLI_ASSOC)) {
$pids[] = intval($row['pid']);
}
$apns->newMessage($pids);
$apns->addMessageAlert($_POST['apns_message']);
$apns->addMessageSound('chime');
The error was in the mobile provisioning files. Deleting all my provisioning files, redownload them and rebuild worked. Take a look at the original post for a way to send out push notifications to all registered devides with Easy APNs.
I had the same problem. Had to regenerate the Distribution provisioning profile in the iOS Developer portal, "Certificates, Identifiers & Profiles".
- Under "Provisioning Profiles", select "Distribution".
- Select your distribution profile.
- Click Edit.
- Click Generate.
精彩评论