6 Star 2 Fork 2

阿债 / apn-pusher

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

libcapn

Build Status MIT

libcapn is a C Library to interact with the Apple Push Notification Service (APNs for short) using simple and intuitive API. With the library you can easily send push notifications to iOS and OS X (>= 10.8) devices.

Version 2.0 isn't compatible with 1.0

Compile libcapn and apn-pusher

git clone https://github.com/azhai/apn-pusher.git
git submodule update --init
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-static-libgcc" \
    -DCMAKE_INSTALL_PREFIX=/opt/apn-pusher-2.0.2 ../
make
sudo make install

cd /opt/apn-pusher-2.0.2/
patchelf --set-rpath '$ORIGIN:$ORIGIN/../lib/capn' bin/*
chmod +x bin/apn-pusher
sudo ln -s /opt/apn-pusher-2.0.2/bin/apn-pusher /usr/bin/

Usage of pypush

cd ~/projects/
cp -r apn-pusher/src/pypusher ./
cd pypusher
pip install -r requirements.txt
#change settings.py and certs/prod.p12
python pusher.py

Table of Contents

Installation

on *nix

Requirements

  • CMake >= 2.8.5
  • Clang 3 and later or GCC 4.6 and later
  • make

Build instructions

$ git clone https://github.com/adobkin/libcapn.git
$ git submodule update --init
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ../
$ make
$ sudo make install

on Windows

Requirements

Build instructions

  1. Download the latest source archive from GitHub and extract it somewhere on your disk, e.g. C:\libcapn

  2. Open command console (Win-R ==> "cmd" => Enter)

  3. Go to the libcapn directory and run win_build\build.bat

cd C:\libcapn
win_build\build.bat

apn-pusher

apn-pusher - simple command line tool to send push notifications to iOS and OS X devices:

apn-pusher -c ./test_push.p12 -p -d -m 'Test' -t 1D2EE2B3A38689E0D43E6608FEDEFCA534BBAC6AD6930BFDA6F5CD72A808832B:1D2EE2B3A38689E0D43E6608FEDEFCA534BBAC6AD6930BFDA6F5CD72A808832A
apn-pusher -c ./test_push.p12 -P 123456 -d -m 'Test' -T ./tokens.txt -o ./logs/push.log -v
python pusher.py tokens.txt '我们的APP有了新功能,请大家升级吧!'

Options:

Usage: apn-pusher [OPTION]
    -h Print this message and exit
    -c Path to .p12 file (required)
    -P Passphrase string for .p12 file
    -p Passphrase for .p12 file. Will be asked from the tty
    -d Use sandbox mode
    -m Body of the alert to send in notification
    -a Indicates content available
    -b Badge number to set with notification
    -s Name of a sound file in the app bundle
    -i Name of an image file in the app bundle
    -y Category name of notification
    -t Tokens, separated with ':' (required)
    -T Path to file with tokens
    -o Path to logging file
    -v Make the operation more talkative
Copyright (c) 2013-2015 Anton Dobkin <anton.dobkin@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

A simple C Library for interact with the Apple Push Notification Service (APNs) 展开 收起
C
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C
1
https://gitee.com/azhai/apn-pusher.git
git@gitee.com:azhai/apn-pusher.git
azhai
apn-pusher
apn-pusher
master

搜索帮助