openpp/notificationhubs-rest-php

Microsoft Azure Notification Hub的PHP库

0.5.0 2015-11-05 03:32 UTC

This package is not auto-updated.

Last update: 2024-09-28 17:24:57 UTC


README

Build Status StyleCI Build Status Code Rating

这是一个使用PHP后端实现的REST封装器,基于Notification Hubs的REST API

如何使用上述代码

初始化你的Notification Hubs客户端(根据入门教程中的说明替换连接字符串和hub名称)

$hub = new NotificationHub("connection string", "hubname"); 

然后根据你的目标移动平台添加相应的发送代码。

iOS

$factory = new NotificationFactory();
$notification = $factory->createNotification("apple", "Hello from PHP!");
$hub->sendNotification($notification);

Android

$factory = new NotificationFactory();
$notification = $factory->createNotification("gcm", "Hello from PHP!");
$hub->sendNotification($notification);

注意

此代码按原样提供,不提供任何保证。