Coder Social home page Coder Social logo

ios-apns-server's Introduction

APNS-Server 使用方法

Python 版(支持批量推送)

db.py:

数据库相关语句换成自己的

push.py:

测试用 Token 换成自己的
testArr = ['5a15ef81cfa4b9dd11a448b6e8f7620d09475711dcd754be87d61a581c94189d','5a15ef81cfa4b9dd11a448b6e8f7620d09475711dcd754be87d61a581c94189d']

沙盒环境和证书名称修改下
session = Session()
con = session.get_connection("push_production", cert_file="cert.pem")

推送内容和小角标修改下
message = Message(array, alert="新版已经发布啦~觉得好用可以分享~", badge=1)

PHP 版

// Put your device token here (without spaces):
// 放置你的 device token:
$deviceToken = '****';

// Put your private key's passphrase here:
// 放置你的私钥密码:
$passphrase = 'xxxx';

// Put your alert message here:
// 放置你的提示信息:
$message = '杰哥是天才!!';

// Put your category id here:
// 放置你的分类id:
$category = 'alert';

这四个字段改成自己的,ck.pem 换成自己的,具体的制作方法可以看我的博客 iOS8的推送

分类 id 是 iOS8 的新特性,需要根据自己情况来设置,上面的博客中有介绍。

Run

php simplepush.php

python push.py

ios-apns-server's People

Contributors

pupboss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.