Coder Social home page Coder Social logo

laravel-notification-channels / facebook Goto Github PK

View Code? Open in Web Editor NEW
151.0 151.0 32.0 115 KB

๐Ÿ“จ Facebook Notifications Channel for Laravel

Home Page: https://laravel-notification-channels.com/facebook/

License: MIT License

PHP 100.00%
facebook facebook-api facebook-bot facebook-graph-api facebook-messenger facebook-messenger-bot facebook-notification facebook-page hacktoberfest laravel laravel-5-package laravel-6-package laravel-7-package laravel-8-package laravel-notification-channels laravel-notifications notifications php

facebook's People

Contributors

casperboone avatar davidpiesse avatar dostrog avatar enniel avatar freekmurze avatar henokv avatar irazasyed avatar jclappiway avatar laravel-shift avatar mirnaxvb avatar mpociot avatar oyed avatar pschocke avatar themsaid 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

facebook's Issues

Some Classes are missing

NotificationChannels\Facebook\Enums\NotificationType
NotificationChannels\Facebook\Component\Button

are not found. Kindly can you update the code?

100 - OAuthException (#100) param recipient must be non-empty

Hi,

Just made a fresh clone of this repo and I'm getting "100 - OAuthException (#100) param recipient must be non-empty error" in laravel logs whenever I try sending text message. Meanwhile the version fetched via composer require laravel-notification-channels/facebook works fine.

Error when Installing Package on Laravel 5.7

Can you guys add support for 5.7 please.

Using version ^0.0.2 for laravel-notification-channels/facebook
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for laravel-notification-channels/facebook ^0.0.2 -> satisfiable by laravel-notification-channels/facebook[0.0.2].
    - Conclusion: remove laravel/framework v5.7.0
    - Conclusion: don't install laravel/framework v5.7.0
    - laravel-notification-channels/facebook 0.0.2 requires illuminate/notifications 5.3.* || 5.4.* || 5.5.* || 5.6.* -> satisfiable by illuminate/notifications[5.3.x-dev, 5.4.x-dev, 5.5.x-dev, 5.6.x-dev, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.25, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9].
    - don't install illuminate/notifications 5.3.x-dev|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications 5.4.x-dev|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications 5.5.x-dev|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications 5.6.x-dev|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.3.0|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.3.16|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.3.23|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.3.4|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.4.0|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.4.13|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.4.17|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.4.19|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.4.27|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.4.36|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.4.9|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.5.0|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.5.16|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.5.17|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.5.2|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.5.28|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.5.33|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.5.34|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.5.35|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.5.36|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.5.37|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.5.39|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.5.40|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.5.41|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.5.43|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.0|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.1|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.10|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.11|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.12|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.13|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.14|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.15|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.16|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.17|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.19|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.2|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.20|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.21|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.22|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.23|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.24|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.25|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.26|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.27|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.28|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.29|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.3|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.30|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.31|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.32|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.33|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.34|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.35|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.36|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.37|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.38|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.4|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.5|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.6|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.7|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.8|don't install laravel/framework v5.7.0
    - don't install illuminate/notifications v5.6.9|don't install laravel/framework v5.7.0
    - Installation request for laravel/framework (locked at v5.7.0, required as 5.7.*) -> satisfiable by laravel/framework[v5.7.0].

Currently only uses Button Template

This currently only uses the Button Template for Facebook Messenger.
Is this intentional to restrain its ability.
For example we could also allow sending of

  • Attachments (files, images etc)
  • Generic message
  • Receipts
  • Basic text message with no buttons

If you want this functionality I can add this but I will have to rip up a bit of code that forces it currently down the Button Template route.

Another tweak I can add in:

  • Change API version to 2.7 (latest)

Code review

Ping me when you're done writing the code and readme, then I'll do a code review.

How to get fb_messenger_user_id ?

Thanks for the great channel. @irazasyed

I have a basic question, how do we get "fb_messenger_user_id"?

Is there any way to get it and store it to 'users' table associated with user?

Thanks in advance.

appsecret_proof requrired

If I send a message via this package, I get the error from facebook that for the graph-api an appsecret_proof is required:

NotificationChannels/Facebook/Exceptions/CouldNotSendNotification with message 'Facebook resonded with an error 100 - GraphMethodException API calls from the server require an appsecret_proof argument'

If I attach it manually in the api method, the message is getting send. Is there a problem with my implementation or is this something new?

I am happy to PR my changes if there is any demand for this.

Page scoped user id

Hello,

I'm currently trying to send messages to facebook users.
However I only have access to the app scoped user ids, which I got after a successful 'login with facebook' process.

I've been researching this for hours and I can't find anything relevant or/and up to date to get the page scoped user id.

Could you provide some help on how to proceed to get this ?

Thanks,

Messaging Phone Number

Is it possible to show an example on how to message someone using a phone number??

return FacebookMessage::create() 
            ->to('+5521999823030')
            ->text('potato')

The format is: "+1(212)555-2368"
Correct?
But Im trying to send a message to a non-US phone...

Can someone tell me if using numbers from outside US is supported??

Btw, my output is:
"message": "Facebook responded with an error 100 - OAuthException (#100) Param recipient[id] must be a valid ID string (e.g., "123")"

updating pages

Hi,

How can I update my Facebook page with this package?

for example currently I'm updating my twitter account like:

public function toTwitter($post)
    {
        return (new TwitterStatusUpdate("New Article is here \n - $post->title  \n http://domain.pp/blog/$post->slug"))->withImage('http://domain.pp/storage/images/'.$post->image);
    }

but in this package documents i didn't find any sample for that matter, all i saw was about sending message.

can anyone help me with that?

Installation Guide

Hey,

just tried it and it is working. Great work!
Only one two things I that could be better:

1.) Installation description
If you're not into Facebook it is really hard to understand what is happening and what are we / you going to achieve. Where does the message pop up? Which chat window between who?

I would also add some information about the "page-scoped User ID" what that is and where to get that. I got a chatbot already setup where I copied this ID, but I would not know where else I could get ip.

2.) Optional to() method. What is happening if I don't use that method? I didn't get that.

Cheers

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.