Copyright © Inaka <hello@inaka.net>
Main module for apns4erl API. Use this one from your own applications.
Copyright 2017 Erlang Solutions Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.device_id() = binary()
feedback() = apns_feedback:feedback()
headers() = #{apns_id => binary(), apns_expiration => binary(), apns_priority => binary(), apns_topic => binary(), apns_collapse_id => binary(), apns_push_type => binary(), apns_auth_token => binary()}
json() = #{binary() => binary() | json()}
response() = {integer(), [term()], [term()] | no_body} | timeout
token() = binary()
close_connection/1 | Closes the connection with APNs service. |
connect/1 | Connects to APNs service. |
connect/2 | Connects to APNs service with Provider Certificate or Token. |
default_headers/0 | Get the default headers from environment variables. |
generate_token/2 | |
get_feedback/0 | |
get_feedback/1 | |
push_notification/3 | Push notification to APNs. |
push_notification/4 | Push notification to certificate APNs Connection. |
push_notification_token/4 | Push notification to APNs with authentication token. |
push_notification_token/5 | Push notification to authentication token APNs Connection. |
start/0 | Used when starting the application on the shell. |
stop/0 | Stops the Application. |
wait_for_connection_up/1 | Wait for the APNs connection to be up. |
close_connection(ConnectionId::apns_connection:name() | pid()) -> ok
Closes the connection with APNs service.
connect(Connection::apns_connection:connection()) -> {ok, pid()}
Connects to APNs service
connect(Type::apns_connection:type(), ConnectionName::apns_connection:name()) -> {ok, pid()}
Connects to APNs service with Provider Certificate or Token
default_headers() -> apns:headers()
Get the default headers from environment variables.
generate_token(TeamId::binary(), KeyId::binary()) -> token()
get_feedback() -> [feedback()] | {error, term()} | timeout
get_feedback(Config::apns_feedback:feedback_config()) -> [feedback()] | {error, term()} | timeout
push_notification(ConnectionId::apns_connection:name() | pid(), DeviceId::device_id(), JSONMap::json()) -> response() | {error, not_connection_owner}
Push notification to APNs. It will use the headers provided on the environment variables.
push_notification(ConnectionId::apns_connection:name() | pid(), DeviceId::device_id(), JSONMap::json(), Headers::headers()) -> response() | {error, not_connection_owner}
Push notification to certificate APNs Connection.
push_notification_token(ConnectionId::apns_connection:name() | pid(), Token::token(), DeviceId::device_id(), JSONMap::json()) -> response() | {error, not_connection_owner}
Push notification to APNs with authentication token. It will use the headers provided on the environment variables.
push_notification_token(ConnectionId::apns_connection:name() | pid(), Token::token(), DeviceId::device_id(), JSONMap::json(), Headers::headers()) -> response() | {error, not_connection_owner}
Push notification to authentication token APNs Connection.
start() -> ok
Used when starting the application on the shell.
stop() -> ok
Stops the Application
wait_for_connection_up(Server::pid()) -> ok
Wait for the APNs connection to be up.
Generated by EDoc