How to get Quickblox avatar images - quickblox

I am using
QBChatMessage
to get all messages sent in the chat.
How can I get the sender's profile photo and user ID?

User ID:
message.senderID
Avatar:
1) Get user body by ID:
[QBUsers userWithID:message.senderID delegate:self];
2) Download avatar http://quickblox.com/developers/SimpleSample-users-ios#Update_profile_picture_.28avatar.29

Related

From attribute inside node mailer message not working always keep sending mail through default account which is used for creating account

let message={
from:email,
to:emails,
text:'Please join the meeting',
subject:`You are Invited for ${meetingName}`,
html:mail
}
Above is my message object the from attribute is not working. I want to send email from logged in user to the user given by him , but node mailer uses the email (my email which is configured at auth) it must use email given in from tag.
const config={
service:'gmail',
auth: {
user:"xx#gmail.com",
pass: ""
},
port:465,
host:'smtp.gmail.com'
}
always uses xx#gmail.com instead of logged in user

React Native Expo Push notification for specific user

Expo allows you to send notification by device id which is ambiguous and not great for my use case, how can i send notification that only specific user will receive? for example can i pass user id or username besides device id?
this is the body request body:
{
to: pushToken, // user id or topic?
body: 'test notification',
data: { withSome: 'data' }
}
You have to create a db table where you'll record user_id / username & device_token in order to be able to send notification to a user by his user_id or username.

Getstream getting a 403 NotAllowedException error when getting the feed

I'm trying to setup a demo where a user can get notification about what's going on in his workspace.
I've shaped this model with a notification feed of type notification and a workspace feed of type flat
Both user and workspace are identified in the getstream world by their IDs
The user's notification feed follows his workspaces's workspace feed.
Server side:
const client = stream.connect(apiKey, secret, appId)
const feed = client.feed('notification', userId).follow('workspace', workspaceId, (r, e) => console.log("result: ", r, "error: ", e))
Then in the app I want to subscribe to notification feed to get new notifications in realtime and also retrieve the last 5 notifications to show them in a dropdown (facebook style):
const streamClient = stream.connect(apiKey, token, appId)
notificationFeed = streamClient.feed('notification', userId)
subscription = notificationFeed.subscribe(handleNewEvents)
notificationFeed.get.get({mark_seen: true, limit: 5})
This last get Request is rising a 403 error:
{"detail":"You don't have permission to do this","status_code":403,"code":17,"exception":"NotAllowedException","duration":"0.10ms"}
what can be the reason?
did you see the tutorial on this? https://getstream.io/docs/#notification-system
Note Step 3 and creating the readonly token. Is that what's missing?
I generated a new client token for the app and this fixed the error

api Telegram webhook : how can delete new_chat_participant message

I created a bot via webhook method of api telegram and It's okay and working.
but I want know how can delete any new_chat_participant messages before sending message by members.
You know that telegram don't send request to your hook url until have not any message with members !!!!!!!
I need just message_id for example when a member add an another to supper group.
Set /setprivacy to disable in #BotFather to receive the whole actions and messages from your group. (In order to delete these messages, the bot must has access to messages in the group, needs to be administrator).
When new member has been added to group, you will receive a json in your webhook something like this:
{ update_id: 123123123,
message:
{ message_id: 2599, // Pay attention to this message id
from: {
...
},
chat: {
id: -987372183 // This is your group's id
...
},
date: 1582378239,
new_chat_participant: { // Field when new member is added to group
}
...
}
Now you need to send a post request to Telegram to delete this message (action). The request is:
request.post("https://api.telegram.org/botYOUR_BOT_TOKEN/deleteMessage?chat_id=GROUP_ID&message_id=MESSAGE_ID_RECEIVED", ... )
Hope this helps.

Fetching list of user's friends for website

I have implemented Fb login for my website. Also for the Fb page of my app inside approved items it shows - user_friends
Provides access to a person's list of friends that also use your app. This permission is approved by default.
How can I get the list of friends of the user who is there on my app ?
Also When I try to do this --
FB.api(
"/me/friends",
function (response) {
if (response && response.data){
alert(response.data);
} else {
console.log('Something goes wrong', response);
}
}
);
I get no response.
Thanks,
Newbie
First, you need to include and initialize the JavaScript SDK: https://developers.facebook.com/docs/javascript/quickstart/v2.2
Then, you need to authorize the user: https://developers.facebook.com/docs/reference/javascript/FB.login/v2.0
(donĀ“t forget to use the scope parameter with the "user_friends" permission)
After that, you can call FB.api('/me/friends'... to get the friends of the user who authorized the App too.
You can also test /me/friends in the API Explorer, just select the correct App: https://developers.facebook.com/tools/explorer/?method=GET&path=me%2Ffriends&version=v2.2