valga / fbns-react Goto Github PK
View Code? Open in Web Editor NEWA PHP client for the FBNS built on top of ReactPHP
License: MIT License
A PHP client for the FBNS built on top of ReactPHP
License: MIT License
Incompatible with PHP 8
Hello @valga !
In the latest version of Instagram API we use:
use BinSoul\Net\Mqtt\DefaultPacketFactory;
Since we are using an outdated version we are getting:
Fatal error: Uncaught Error: Class 'BinSoul\Net\Mqtt\DefaultPacketFactory' not found in /Users/MarkZuckerberg/Documents/GitHub/Instagram/src/Realtime/Mqttot/ReactMqttClient.php:124
Stack trace:
#0 /Users/MarkZuckerberg/Documents/GitHub/Instagram/src/Realtime/Mqtt.php(573): InstagramAPI\Realtime\Mqttot\ReactMqttClient->__construct(Object(InstagramAPI\React\Connector), Object(React\EventLoop\ExtEventLoop), NULL, Object(InstagramAPI\Realtime\Mqtt\StreamParser))
#1 /Users/MarkZuckerberg/Documents/GitHub/Instagram/src/Realtime/Mqtt.php(130): InstagramAPI\Realtime\Mqtt->_getClient()
#2 /Users/MarkZuckerberg/Documents/GitHub/Instagram/src/Realtime.php(119): InstagramAPI\Realtime\Mqtt->__construct(Object(InstagramAPI\Realtime), Object(InstagramAPI\React\Connector), Object(InstagramAPI\Realtime\Mqtt\Auth), Object(InstagramAPI\Devices\Device), Object(InstagramAPI\Instagram), Object(React\EventLoop\ExtEventLoop), Object(Monolog\Logger), Array)
#3 /Users/MarkZuckerberg/Documents/GitHub/Instagram/src/Realtime.php(80): InstagramAPI\Realtime->_buildMqttClient()
#4 /Users/MarkZuckerberg/Doc in /Users/MarkZuckerberg/Documents/GitHub/Instagram/src/Realtime/Mqttot/ReactMqttClient.php on line 124
DefaultPacketFactory
is only available in:
"binsoul/net-mqtt-client-react": "^0.6.0",
and upwards. Because of this change, it is also required:
"react/socket": "^1.3",
So it would be great if you could update composer to avoid:
Problem 1
- valga/fbns-react 0.1.9 requires react/socket ~0.8 -> satisfiable by react/socket[v0.8.1, v0.8.8, v0.8.2, v0.8.6, v0.8.9, v0.8.4, v0.8.0, v0.8.5, v0.8.11, v0.8.12, v0.8.3, v0.8.10, v0.8.7] but these conflict with your requirements or minimum-stability.
- valga/fbns-react 0.1.9 requires react/socket ~0.8 -> satisfiable by react/socket[v0.8.1, v0.8.8, v0.8.2, v0.8.6, v0.8.9, v0.8.4, v0.8.0, v0.8.5, v0.8.11, v0.8.12, v0.8.3, v0.8.10, v0.8.7] but these conflict with your requirements or minimum-stability.
- valga/fbns-react 0.1.9 requires react/socket ~0.8 -> satisfiable by react/socket[v0.8.1, v0.8.8, v0.8.2, v0.8.6, v0.8.9, v0.8.4, v0.8.0, v0.8.5, v0.8.11, v0.8.12, v0.8.3, v0.8.10, v0.8.7] but these conflict with your requirements or minimum-stability.
- Installation request for valga/fbns-react ^0.1.9 -> satisfiable by valga/fbns-react[0.1.9].
Also your packagist isn't automatically updated, probably the hook was outdated, I requested an update through packagist so now it has 0.1.9
.
Best regards!
I got this error
Failed to register package 'com.instagram.android': Out of bounds vec access: invalid index 1 #0 /var/www/flib/messaging/realtime/delivery/RealtimeDeliveryAuth.php(35): RealtimeDeliveryAuth::genSetLoginStateFromInstagramAuthToken() #1 /var/www/flib/messaging/realtime/delivery/RealtimeDeliveryAuth.php(13): RealtimeDeliveryAuth::genSetAuthFromUserIDAndSessionInfo() #2 /var/www/flib/messaging/realtime/RealtimeDeliveryHandler.php(61): RealtimeDeliveryAuth::genSetAuthFromEndpointState() #3 /var/www/flib/__generated__/ThriftMeerkatStep/fbcode/rtgw/v2/extif/delivery.thrift/RealtimeDeliveryBackend.php(426): RealtimeDeliveryHandler->sendRealtimeDeliveryRequest() #4 /var/www/flib/thrift/core/ThriftAsyncProcessor.php(38): RealtimeDeliveryBackendAsyncProcessorBase->process_sendRealtimeDeliveryRequest() #5 /var/www/flib/thrift/servers/base/ThriftServer.php(364): ThriftAsyncProcessor->processAsync() #6 /var/www/flib/alite/x/controller/thrift/XThriftControllerBaseTrait.php(41): ThriftServer->genHandleHTTPRequest() #7 /var/www/flib/alite/x/controller/thrift/XThriftBridgeController.php(34): XThriftController->genThriftResponse() #8 /var/www/flib/init/routing/ZeusGodOfThunderAlite.php(226): XThriftBridgeController->genResponse() #9 /var/www/flib/attribution/AttributionEdge.php(83): Closure$ZeusGodOfThunderAlite::genMain#4() #10 /var/www/flib/gates/turbo/context/BaseTurboGatesContext.php(262): AttributionEdge::runWithDeferredAttributionResolution() #11 /var/www/flib/init/routing/ZeusGodOfThunderAlite.php(227): BaseTurboGatesContext->genRunWithoutCatching() #12 /var/www/flib/init/zeusgodofthunder/__entrypoint.php(118): ZeusGodOfThunderAlite->genMain() #13 /var/www/flib/init/zeusgodofthunder/__entrypoint.php(53): ZeusGodOfThunderEntryPoint::genMain() #14 (): gen_zeusgodofthunder_main() #15 (): Closure$__SystemLib\enter_async_entry_point() #16 (): HH\Asio\join() #17 (): __SystemLib\enter_async_entry_point() #18 {main}
My register functoion:
$client->register(Constants::PACKAGE_NAME, Constants::FACEBOOK_ANALYTICS_APPLICATION_ID) ->then(static function (Registration $registration) { $this->_logger->info('Received a non-empty token.' . $registration->getToken()); $this->emit('fbns_token', [$registration->getToken()]); })->otherwise(static function ($e) { $this->_logger->error($e); });
Any ideas what can be wrong?
fbns-react/src/Auth/DeviceAuth.php
Lines 25 to 30 in d370bdf
ck
and cs
in the CONNACK packet denote connection key and connection secret. Might be a bit confusing to use userId
and password
here in the traditional MQTT sense.
Line 89 in d370bdf
Just did a slight review here while trying to debug an issue with my own library, should this not be:
$this->clientStack = self::FBNS_CLIENT_STACK;
It doesn't seem to have any negative effect right now in any case.
Exception 'Error' with message 'Call to a member function write() on null in /app/vendor/valga/fbns-react/src/Lite/ReactMqttClient.php:615'
#0 /app/vendor/valga/fbns-react/src/Lite/ReactMqttClient.php(493): Fbns\Client\Lite\ReactMqttClient->startFlow(Object(BinSoul\Net\Mqtt\Flow\IncomingPublishFlow))
#1 /app/vendor/valga/fbns-react/src/Lite/ReactMqttClient.php(465): Fbns\Client\Lite\ReactMqttClient->handlePacket(Object(BinSoul\Net\Mqtt\Packet\PublishRequestPacket))
#2 /app/vendor/valga/fbns-react/src/Lite/ReactMqttClient.php(391): Fbns\Client\Lite\ReactMqttClient->handleReceive('2\xAC\x04\x00\x0276*\xADx\xDA\x95R]o...')
#3 /app/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): Fbns\Client\Lite\ReactMqttClient->Fbns\Client\Lite\{closure}('2\xAC\x04\x00\x0276*\xADx\xDA\x95R]o...')
#4 /app/vendor/react/stream/src/Util.php(71): Evenement\EventEmitter->emit('data', Array)
#5 /app/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): React\Stream\Util::React\Stream\{closure}('2\xAC\x04\x00\x0276*\xADx\xDA\x95R]o...')
#6 /app/vendor/react/stream/src/DuplexResourceStream.php(193): Evenement\EventEmitter->emit('data', Array)
#7 [internal function]: React\Stream\DuplexResourceStream->handleData(Resource id #34791, Object(React\EventLoop\StreamSelectLoop))
#8 /app/vendor/react/event-loop/src/StreamSelectLoop.php(236): call_user_func(Array, Resource id #34791, Object(React\EventLoop\StreamSelectLoop))
#9 /app/vendor/react/event-loop/src/StreamSelectLoop.php(205): React\EventLoop\StreamSelectLoop->waitForStreamActivity(990672)
{
"require": {
"php": ">=7.0.0",
"ext-curl": "*",
"ext-mbstring": "*",
"ext-bcmath": "*",
"react/event-loop": "^0.4.3",
"react/promise": "^2.5",
"react/socket": "^0.8",
"binsoul/net-mqtt-client-react": "^0.3.2",
"clue/socks-react": "^0.8.2",
"clue/http-proxy-react": "^1.1.0",
"valga/fbns-react": "^0.1.8",
}
}
May you tell us how you got the mqtt traffic?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.