-
Notifications
You must be signed in to change notification settings - Fork 14
Adding Topic Creation And Subscription And Validating FCM Token #5
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I also added some stuff for token validation and the method is tested and it works. (It's only one method only). |
Hi @Stevemoretz |
Hi @williamdes ,
Anyways all fixed I guess. |
Anyways what's the deal with these phpdocs at all? |
For an example for this fix check FCMValidator class I added a php docs so my method : /**
* @method static bool validateToken( $token )
*/
class FCMValidator extends Facade{
protected static function getFacadeAccessor()
{
return 'fcm.validator';
}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel bad for requesting so much changes, I approve your work
💯
Oh okay, maybe |
Sure there you go. Now I think the next step would be to fix other php docs of the facades. |
Maybe phpstan is be the tool that we should use to be sure everything is fixed |
No problem man Done all your other requests. |
In a crazy cool way |
Have never used phpstan though. |
Co-authored-by: Steve Moretz <[email protected]> Co-authored-by: William Desportes <[email protected]>
Yup, I used IDE helper and it works fine !
Give it a try you will love it ! |
I did lint fixes and added the author (@asachanfbd) back onto the commit and set ourselves to co-editors |
Sure it is it magically created those php docs for me. And Sure I'm right now installing phpstan thank you for introducing it! |
Could you have a try to see if the façades are okay on the commit f04fdc8 ? You can |
I tried it right now.Not really there isn't any phpdoc on FCMGroup for instance. |
Could you paste here the generated IDE helper part for FCM ? |
Sure I guess it would be this part? namespace LaravelFCM\Facades {
/**
*
*
*/
class FCM {
/**
* send a downstream message to.
*
* - a unique device with is registration Token
* - or to multiples devices with an array of registrationIds
*
* @param string|array $to
* @param \LaravelFCM\Sender\Options|null $options
* @param \LaravelFCM\Sender\PayloadNotification|null $notification
* @param \LaravelFCM\Sender\PayloadData|null $data
* @return \LaravelFCM\Sender\DownstreamResponse|null
* @static
*/
public static function sendTo($to, $options = null, $notification = null, $data = null)
{
/** @var \LaravelFCM\Sender\FCMSender $instance */
return $instance->sendTo($to, $options, $notification, $data);
}
/**
* Send a message to a group of devices identified with them notification key.
*
* @param string $notificationKey
* @param \LaravelFCM\Sender\Options|null $options
* @param \LaravelFCM\Sender\PayloadNotification|null $notification
* @param \LaravelFCM\Sender\PayloadData|null $data
* @return \LaravelFCM\Sender\GroupResponse
* @static
*/
public static function sendToGroup($notificationKey, $options = null, $notification = null, $data = null)
{
/** @var \LaravelFCM\Sender\FCMSender $instance */
return $instance->sendToGroup($notificationKey, $options, $notification, $data);
}
/**
* Send message devices registered at a or more topics.
*
* @param \LaravelFCM\Sender\Topics $topics
* @param \LaravelFCM\Sender\Options|null $options
* @param \LaravelFCM\Sender\PayloadNotification|null $notification
* @param \LaravelFCM\Sender\PayloadData|null $data
* @return \LaravelFCM\Sender\TopicResponse
* @static
*/
public static function sendToTopic($topics, $options = null, $notification = null, $data = null)
{
/** @var \LaravelFCM\Sender\FCMSender $instance */
return $instance->sendToTopic($topics, $options, $notification, $data);
}
}
/**
*
*
*/
class FCMGroup {
/**
* Create a group.
*
* @param string $notificationKeyName
* @param array $registrationIds
* @return null|string notification_key
* @static
*/
public static function createGroup($notificationKeyName, $registrationIds)
{
/** @var \LaravelFCM\Sender\FCMGroup $instance */
return $instance->createGroup($notificationKeyName, $registrationIds);
}
/**
* add registrationId to a existing group.
*
* @param string $notificationKeyName
* @param string $notificationKey
* @param array $registrationIds registrationIds to add
* @return null|string notification_key
* @static
*/
public static function addToGroup($notificationKeyName, $notificationKey, $registrationIds)
{
/** @var \LaravelFCM\Sender\FCMGroup $instance */
return $instance->addToGroup($notificationKeyName, $notificationKey, $registrationIds);
}
/**
* remove registrationId to a existing group.
*
* >Note: if you remove all registrationIds the group is automatically deleted
*
* @param string $notificationKeyName
* @param string $notificationKey
* @param array $registeredIds registrationIds to remove
* @return null|string notification_key
* @static
*/
public static function removeFromGroup($notificationKeyName, $notificationKey, $registeredIds)
{
/** @var \LaravelFCM\Sender\FCMGroup $instance */
return $instance->removeFromGroup($notificationKeyName, $notificationKey, $registeredIds);
}
/**
*
*
* @param \Psr\Http\Message\ResponseInterface $response
* @return bool
* @static
*/
public static function isValidResponse($response)
{
/** @var \LaravelFCM\Sender\FCMGroup $instance */
return $instance->isValidResponse($response);
}
}
} |
Yup, nothing for this PR ? |
Well I think these features are fine now, but in other sections are still problems (not related to these though) like #7
|
Here you are :) |
I merged this pull-request so you can test it on Anyway, thank you for all :) |
I added some tests in 1f5ac55 |
I just released 1.6.0 🎉 |
Essentially I used : brozot#114
And brought it to your repo and made it work removed the errors and all,it works right now without any errors.
However I HAVE NOT TESTED the functionality completely yet.
I have however checked all the methods and it works without any errors.