Code Monkey home page Code Monkey logo

apn's People

Contributors

annagetz125 avatar badchoice avatar barryvdh avatar chimit avatar daangeurts avatar devsaider avatar dwightwatson avatar elfsundae avatar ertogs avatar freekmurze avatar hansnn avatar infostreams avatar joelennon avatar killtw avatar koenhoeijmakers avatar koiiiey avatar laravel-shift avatar lucadegasperi avatar marcroberts avatar mrbrownnl avatar pascalbaljet avatar paurevo avatar priithansen avatar reactivexyz-dev avatar rohitchopramh avatar saundersb avatar steveeakin avatar techguard avatar webocoders avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apn's Issues

SPN - Can this package be used for websites?

I'm implementing safari push notifications, the thing is I can get the device token from my Mac, but I'm not able to send notifications via this channel. I am using it for a web app, so I was wondering maybe this package cant be used for sending from websites to macOS, or I need the ios push certificate and the website push certificate? Currently, I am using one certificate(website push) to generate the push package and to send notifications to APN.
spn

Service Provider?

In the docs, it still states that "NotificationChannels\Apn\ApnServiceProvider::class" needs to be registered in app.php, but it appears this file was removed for the 0.2.0 release.

Is it still needed, or does this just need to be removed from the docs?

How to get the push tokens?

Hi, I have a question about the library. I created the .pem certificate and when doing the command "openssl s_client -cert Push.pem -connect gateway.push.apple.com:2195" this has not occurred any error so I suppose it is ok. I have continued to configure broadcasting and created the notification but it has not worked.
In my broadcasting:

'apn' => [ 'environment' => NotificationChannels\Apn\ApnChannel::PRODUCTION, // Or ApnChannel::SANDBOX 'certificate' => base_path('Push.pem'), 'pass_phrase' => null, ],

In my notification:
`namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Support\Facades\Log;
use NotificationChannels\Apn\ApnChannel;
use NotificationChannels\Apn\ApnMessage;

class ApnPushPruebaNotification extends Notification
{
use Queueable;

public function via($notifiable)
{
    return [ApnChannel::class]; // Make sure you use 'ApnChannel::class', not just 'apn'
}

public function toApn($notifiable)
{
    return ApnMessage::create()
        ->badge(1)
        ->title('Account approved')
        ->body("Your {$notifiable->service} account was approved!");
}

}`

in my notifiable (User):
`
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;

protected $table = 'users';

protected $fillable = [
'name', 
'email', 
    'phone',
    'photo',
'password',
    'type',
    'apn_token'
];

public function routeNotificationForApn()
{
return $this->apn_token;
}
}`

and the function in controller (with "use App\Notifications\ApnPushPruebaNotification") :
`
public function test()
{
$user = Auth::user();
$user->notify(new ApnPushPruebaNotification());

}

`
My question is where do I get the apn tokens? For knowing if that fails, or is something else, thanks for the help.

Tag Release

Would it be possible to get an actual release tagged for this repository? Current in Composer we're being forced to pull in the @dev release, which is never a great idea for a production application.

I'm not sure if there's a reason a specific release hasn't been tagged, but if not it would be preferable to pulling in the latest @dev for sure.

[Proposal] Send notifications via "apn" instead of the full "ApnChannel::class".

Presently, to send these APN notifications, our via function will look something like this:

public function via($notifiable)
{
return [ApnChannel::class];
}

However, I want to be able to send them like this:

public function via($notifiable)
{
return ['apn'];
}

How can this be achieved?

So basically, I want to be able to give a custom name of this APN notification channel called "apn". I looked in the Laravel documentation and it does not seem to be explained how to achieve this, and I also dug into the code a little bit but can't seem to figure it out. It seems like this should be a trivial thing but apparently it's not. If anyone knows how this can be achieved, please post here. If it works well and is agreed to upon by this community potentially we can do a pull request. If for some reason this is not desired or bad practice, please explain why. Either way, it would be nice if this could be achieved.

Thanks for any insight or help you may provide.

Can't find the class ApnChannel

Hi there,

After I add Apn record into config/broadcasting.php
I got an exception "Class 'ApnChannel' not found"

I have tried adding the path "vendor/laravel-notification-channels/apn/src" to composer.json
"autoload": { "psr-4": { "App\\": "app/" }, "classmap": [ "database/seeds", "database/factories", "vendor/laravel-notification-channels/apn/src" ] },

and running artisan package:discover, it does show
Discovered Package: laravel-notification-channels/apn

However, still gives 'Class not found' issue. Any help much appreciated!

Laravel 5.8

1.0.0+ not working with Laravel Vapor

This is more of a PSA than an actual issue, but I felt it make sense to open this. Since the switch to using Pushok for sending notifications, this package currently does not work with Laravel Vapor.

This is due to Pushok requiring curl being compiled with HTTP/2 enabled, and Vapor (currently) not meeting this requirement. I have submitted a ticket to the Vapor team (about a week ago) regarding this, but as of now have not received a response to it.

This is an issue, because in order to upgrade to Laravel 7, we're required to use >= v2.0.0 of this package, which is currently not possible due to the Pushok incompatibility.

It seems to me there are 3 possible solutions here:

  1. Tagging an older version of this package with Laravel 7 support
  2. Getting the Laravel team to update Vapor to support HTTP/2 with curl
  3. Somehow overriding the Pushok code to not use HTTP/2

1 and 2 are certainly better solutions, but for the time being we're stuck on Laravel 6 since we're using Vapor for our environment.

How/Where does the feeback server get used?

I don't understand where to use the feedback service. Is it in a controller?
how is that url registered?

Is it in a service provider? Expanding the docs on this would be veru useful and appreciated.

Update Packagist webhooks so updates are automatic

Looks like the sync between GitHub releases and Packagist isn't working anymore and needs to be updated to use the newer webhooks method. This will allow us to keep publishing new versions.

@themsaid I believe you're the admin of the package on Packagist - would you be able to update the webhook, or add me as a maintainer on Packagist (dwightwatson) so that I can sort it out going forward?

Relevant: #60

need support ios 13 background pushes

the library does not support pushs in background in ios 13, it works fine when set content availble as 1 and send no title and body in olders system version of ios 12 or lower, but when using ios 13 it does not work fine

Notification::fake but something is done

I'm using Notification::fake() to test the notifications but it looks like it does something since the test takes about 800ms to complete, when the other tests that are not using notifications just take 200ms

Let me know if there is anything I can to to verify that is doing something with the network

Thanks!

Use multiple certificates

Hi,
I'd like to use diferent certificates with your package. Is there any way to achieve this?

I'm using one normal notification certificate and I want to add a passKit certificate to notify iOS wallet for updates. It can not be the same...

Feedback service is not connected

APNS requires implementation of receiving feedback. Upstream ZendService has the classes Client\Feedback and Response\Feedback for this purpose. If this is not implemented, Apple can by their means to invalidate the certificates used.

Send Notification to Log

In some cases, when just testing the correct payload of the notification, I think it would be useful to have the notification logged instead of actually sent out.

What do you think? Do you have any suggestions on how I could test notifications without actually sending them?

Add composer.lock to git

I think it would be a good idea to add composer.lock file to git as recommended here

This way we'll be using exactly the same packages version!

Thanks!

Unable to create Custom Clients

i got the exception like "App\Pushok\Client".

if use the token & client class like this "use Pushok\Client;
use Pushok\AuthProvider\Token;"

$customClient = new Client(new Token($options));

i got some other exception

Call to private Pushok\AuthProvider\Token::__construct() from context

Where i need to create custom client from my Notification class Or from ApnServiceProvider?

Problem while loading configuration

Hello,
I have used this package in my project, i have followed the installation guide properly but i am getting an error

Unresolvable dependency resolving [Parameter #2 [ $environment ]] in class NotificationChannels\Apn\ApnChannel

and i am not able to solve it.

If anyone can guide me it will be a great help.

Mistype in code

ApnChannel.php, line 48: $this->passphrase -> $this->passPhrase

Normal and voip push notifications should be sent to different tokens

It's not enough just to specify a voip push type to turn a traditional push notification into a VoIP push notification. Every iOS device has two different device tokens: alarm (normal) and voip. So both should be stored in the DB and retrieved by the routeNotificationFor... method. Apparently, something like a new routeNotificationForApnVoip method is needed.

Status Code 0

Would like to ask how do I properly send a notification. I'm not sure what statusCode:0 really means.

image

apns-push-type support

In order to support ios13 we need to add "apns-push-type" header.

Is this library supports it?

pushType doesn't work properly

I'm using this package version v1.3.0 with Lumen 6 because Lumen 7 hasn't been released yet.

If I use a pushType() method to send voip notifications I get a DeviceTokenNotForTopic error. But if I change APN_BUNDLE_ID env var by adding a .voip suffix it starts working. Apparently, edamov/pushok supports this case.

ApnMessage::create()
    ->pushType('voip')
    ->badge(1)
    ->title('Incoming call')
    ->body('Something here!');

Enable push notifications in laravel?

Hello, I would like to know if it is necessary to enable push notifications in my app. I have never used Xcode and I don't know if I can activate this feature to my Laravel project.

1. Push notification not working 2. Category feature not included

  1. Push notification are not delivered through localhost or https unless route to CA entrust file is added to Zend APN's AbstractBaseClient.php.
  2. The package does not include action to add notification category which is crucial to enable actionable buttons on iOS.

Auth Key

Since Apple has simplified the way developers send notifications with a .p8 auth key. Any plan if this will be brought into this repository?

Will it support multiple apps?

Consider the case, if there are multiple mobile apps for different usertypes. So the certificate files will be different. So how the configuration can be switched?

Certificate authentication disabled?

I'm upgrading a project to laravel-notification-channels/apn 1.3.0 (Laravel 6) and it appears that the service provider is hardcoded on Token with no way to use the Certificate class of edamov/pushok without writing an override service.

Is my understanding correct? And is that a bug, or is it a feature that is supposed to force me to get some new stuff from Apple?

Push Notification + Laravel Task Scheduling + Cron Job

I am writing a cron job that will run on a specific time every day and send all user to push notification but i am not receiving a push notification on an iOS device.

This is my kernel.php file code

protected function schedule(Schedule $schedule) { $schedule->command('er:send-push-notification') ->dailyAt('13:00'); }

this is my code in my ErCronJob.php

public function handle() { $users = User::whereIn('role_id', [2, 3, 4])->where('mobile_number', '9985353442')->get(); foreach ($users as $user) { $message = $this->info('Hello user you got a new notification'); $user->notify(new SendDailyComplaintStatisticsToErs($message)); } }

This is my code in SendDailyComplaintStatisticsToErs.php
public function toApn($notifiable) { return ApnMessage::create() ->badge(1) ->title('Account approved') ->body("Your account is approved!"); }

When i dump my last code i am getting below mention message.

image

Can anyhelp me with this. Thanks**

Update the version so we can use the getFeedback

Just installed the package, and I notices that there isn't the getFeedback method,
I found that it is because in 0.1.0 wasn't there, but it is on the master now,

can you update the tag so we can get the feedback and remove the apropiate tokens?

Thanks!

Code review

Let me know when you're done with the initial code / tests / readme. I'll do a code review and set up packages, and other services

[Proposal] Change message based on device preferences

Since a user can have multiple devices associated to them, some systems store preferences for each device instead of the user itself. It can happen that different devices of a same user use a different API version that needs a different notification payload.

This package already allows to send a notification to multiple devices for the same user at once. I think the next logical step would be to allow to send a different message for each device. What do you think?

Refresh Token object

Since I'm using a worker to send the notification.
the token eventually expires. Should there be a way to refresh it?
Per apple doc, you have to refresh Token every 20-60 mins

New release?

Hi could you create a new release with recent changes?

Thanks

How to use multiple bundle ids?

i have two applications with single back end. so i want to use multiple bundle ids to send push notifications to the ios devices. can you please help me to resolve this asap. thanks

Queued notifications not sending

Full disclaimer: I'm new to both notifications and queues.

I can send APN notifications just fine without the queue. When I implement ShouldQueue my queues are created and fired, but $notifiables is empty in SendQueuedNotifications.php

I posted about this on the Laracasts forum.

My assumption is that adding implement ShouldQueue is what I'm supposed to do to get these notifications to queue*. After a day of banging my head on my desk trying to find out where this is failing, I'm completely unsure where else I should be looking.

*Edit: and they are queueing. I am using the database driver locally and beanstalkd on my server. The rows are being created, and removed when I php artisan queue:work I've logged and debugged up and down and see that $notifiables is empty in SendQueuedNotifications.php when the queue fires.

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.