Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

APNS class file #42

Open
Sharespot opened this issue Apr 26, 2016 · 3 comments
Open

APNS class file #42

Sharespot opened this issue Apr 26, 2016 · 3 comments

Comments

@Sharespot
Copy link

Hello,

I've it all installed but I haven't seem any APNS class file to setup host, pem and port. No configurations file at all were created when I installed the gem.

What am I missing?

Thanks!

@jlstr
Copy link

jlstr commented May 11, 2016

right, I'm facing the same issue. found the answer yet @Sharespot?

@alpriest
Copy link

The file is a gem so you don't use the 'file' directly inside your project, you just require it. See below how to send a message using it from the command line.

$ irb
> require 'APNS'
=> true
> APNS.pem = '/path/to/file'
=> '/path/to/file'
> APNS.send_notification(token, 'hello world')
=> nil

@Sharespot
Copy link
Author

@jlstr sorry, the notification went to the company's mail and I hadn't seem it until now.

I did like @alpriest said although I didn't even have to require it... I just did

              APNS.pem = '/home/ubuntu/magikey_server/apns.pem'
              APNS.send_notification(mobile.token,message)

inside my code each time I wanted to send a notification and it worked.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants