APNS icon indicating copy to clipboard operation
APNS copied to clipboard

APNS class file

Open Sharespot opened this issue 8 years ago • 3 comments

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!

Sharespot avatar Apr 26 '16 20:04 Sharespot

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

jlstr avatar May 11 '16 19:05 jlstr

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

alpriest avatar Jul 18 '16 20:07 alpriest

@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.

Sharespot avatar Jul 19 '16 14:07 Sharespot