向特定用户发送PHP iOS推送通知

向特定用户发送PHP iOS推送通知,php,ios,mysql,objective-c,notifications,Php,Ios,Mysql,Objective C,Notifications,我目前正在使用推送机器人从PHP网站向iOS设备发送推送通知。我可以使用特定用户注册推送通知(允许)后添加的设备令牌向特定用户发送通知。问题是,我想在向特定用户(设备)发送直接消息(在网站上)时向他们发送推送通知,但我如何(或是否可能)将推送通知注册到PushBots后,将设备令牌添加到my MySQL数据库中,以便在发送直接消息后可以将推送通知发送到特定用户(设备) 下面是PHP代码 <?php // Push The notification with parameters requ

我目前正在使用推送机器人从PHP网站向iOS设备发送推送通知。我可以使用特定用户注册推送通知(允许)后添加的设备令牌向特定用户发送通知。问题是,我想在向特定用户(设备)发送直接消息(在网站上)时向他们发送推送通知,但我如何(或是否可能)将推送通知注册到PushBots后,将设备令牌添加到my MySQL数据库中,以便在发送直接消息后可以将推送通知发送到特定用户(设备)

下面是PHP代码

<?php

// Push The notification with parameters
require_once('PushBots.class.php');
$pb = new PushBots();
// Application ID
$appID = 'xxxxxxxxxxxxx';
// Application Secret
$appSecret = 'xxxxxxxxxxxxx';
$pb->App($appID, $appSecret);


$pb->AliasData(1, "xxxxxxxxxxxxx", "test");
// set Alias on the server
$pb->setAlias();

// Push it !
$pb->Push();

// Push to Single Device
// Notification Settings
$pb->AlertOne("New message from Skillet");
$pb->PlatformOne("0");
//device token of a specific device
$pb->TokenOne("xxxxxxxxxxxxx");

//Push to Single Device
$pb->PushOne();

?>
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
    //Handle notification when the user click it while app is running in background or foreground.
    [[Pushbots sharedInstance] receivedPush:userInfo];
}

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    // This method will be called everytime you open the app
    // Register the deviceToken on Pushbots
    [[Pushbots sharedInstance] registerOnPushbots:deviceToken];
}
-(void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error{
    NSLog(@"Notification Registration Error %@", [error userInfo]);
}