Closed ChdML closed 2 years ago
Yes it is possible. It's been a bit since I implemented the messaging stuff but from what I remember, you first need to get a messaging group (or create one):
$group = $client->groups()->first(); // This would get the first group (I think it's ordered by last message time)
// Or filter
$groups = $client->groups()->with('tustin25'); // Groups with my user id for example (you would have to loop this method since it's possible to have multiple groups with a user)
When you have the group you want, you can then send a message to it. You can send a few types of messages (text, image, audio) but I can't remember if they have all been implemented. I know I did text messages however:
$group->sendMessage(new TextMessage('Test message'));
That should get you started, assuming nothing has broken when is definitely possible since it's been like 2 years since I last touched that part of the library. If it doesn't work, please let me know and I can try to assist further!
I've tested this, and apparently it is working, but you must use a npsso token
of an account that has been validated in some console (PS4, PS5...), I mean you must login at least once in some console with the account you are using the npsso
, otherwise groups()
, media()
and cloudMediaGallery()
will be unavailable and throw the AccessDeniedException
.
At first, I thought it was broken, but if you access the app with new accounts, you get the same error and an alert to validate the account at some console to unlock all features, doing it you can access via the API as well.
...you must login at least once in some console...
Interesting, I need to try that with my own code at some point (KvickPSN). Possibly they have added some kind of "needs to have been logged in to a console within the last n days" or something like that. In my case it wasn't critical, so I just chucked it aside and moved on with other things.
Yes it is possible. It's been a bit since I implemented the messaging stuff but from what I remember, you first need to get a messaging group (or create one):
$group = $client->groups()->first(); // This would get the first group (I think it's ordered by last message time) // Or filter $groups = $client->groups()->with('tustin25'); // Groups with my user id for example (you would have to loop this method since it's possible to have multiple groups with a user)
When you have the group you want, you can then send a message to it. You can send a few types of messages (text, image, audio) but I can't remember if they have all been implemented. I know I did text messages however:
$group->sendMessage(new TextMessage('Test message'));
That should get you started, assuming nothing has broken when is definitely possible since it's been like 2 years since I last touched that part of the library. If it doesn't work, please let me know and I can try to assist further!
Alright thank you
Is it possible to read/send messages? there's no documentation about it but I've seen old issues talk about, and I couldn't figure it out. How can I do it if its possible