I'm implementing group chat feature using Layer SDK. From the iOS SDK how can I fetch the LYRConversation instance using the conversation ID considering that I am not a part of that conversation.
LYRQuery class specifies that it runs the queries only on the conversations that I am a part of and hence are stored in my local database.
I'm fetching a list of layer conversation IDs from my backend API (as trending groups feature). There does not seem to be any API provided by Layer's iOS SDK to join another conversation based on it's conversation ID.
Is there a solution to this?
In the above mentioned case, we need to add the user to the conversation via the platform API (on our backend server).
The sync will happen near instantaneously. We also have a newer method called waitForCreationOfObjectWithIdentifier https://developer.layer.com/docs/ios/api#lyrclient
that will let you specify an object id and then it will trigger as soon as that object has synced.
So to solve this issue, we made an API call to our backend server which added the user to the conversation. We also implemented waitForCreationOfObjectWithIdentifier to listen for when the conversation to which the user was added tp was synced to our local db, to inform the user about the same.
Thanks to layer support team for the quick clarification.
Related
If I upload a custom app that has a messaging bot to an MS Teams org (through admin center), is there an event payload that gets sent to the bot messaging payload that lets me know that the app/bot is added to that MS Teams tenant?
Something similar to installationUpdate event: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/subscribe-to-conversation-events?tabs=dotnet#installation-update-event but for adding app to org (this payload event is sent for when users add app to their own MS Teams space)
No, there is no event for this.
Having it installed in a tenant doesn’t do anything except making it available for users to install. And without a user installing it, you cannot interact with the bot.
There are only two ways the app could be added to the org: either (a) by them adding the package manually, in which case presumably you gave it to them, so you should know about it, or (b) by your app being in the public App Store. In this 2nd case, you'll know it's been installed into the tenant by using the same installationUpdate event you mentioned - you can store an entry somewhere on your infrastructure (e.g. a database or otherwise) that tracks which tenants have installed the bot ever before in any channel, and if nothing is found for the incoming tenant id, it must be new.
We are using the graph API to send a message to the General channel of a Microsoft Team, which has a number of members.
We would like to allow any members to interact with the message via an adaptive card.
This is doable using say Action.OpenUrl or .Submit, however we need to know which user it is which is interacting. I imagine this must be a fairly common thing to do.
What solutions and options are available to do this?
For example, is it possible to obtain the user's Team id at the time an action is invoked ?
Every activity sent to the bot has a from property that identifies the user that sent the activity. You can see the full activity schema here. I advise you to run your bot in debug mode so that you can see all the data your bot receives. If you want to run your bot in debug mode and talk to the bot using Teams instead of Emulator, you can use tunneling: https://learn.microsoft.com/azure/bot-service/bot-service-debug-channel-ngrok
I have a fully functioning application that uses Firebase as a backend. I want to be able to have a user receive a notification when a child is added to my Firebase database under that users ID.
I have looked everywhere but all I can find are links to OneSignal or people telling me to "make a custom server" as if it can be done by magic. How do I go about making a server? What language? What do I do with OneSignal? Can someone guide me step by step without telling me to simple make a custom server.
I believe Cloud Functions for Firebase is exactly what you're looking for. Specifically, Realtime Database Triggers:
The Realtime Database supports the onWrite() event, which triggers anytime data is created, destroyed, or changed in a specified database location.
In a typical lifecycle, a Firebase Realtime Database function does the following:
Waits for changes to a particular database location for write events.
Fires when a write event occurs and performs its tasks (see What can I do with Cloud Functions? for examples of use cases).
Receives an event data object that contains two snapshots of the data stored at the specified path: one with the original data prior to the change, and one with the new data.
And going through the What can I do with Cloud Functions?, theres Notifying users:
Notify users when something interesting happens
Developers can use Cloud Functions to keep users engaged and up to date with relevant information about an app. Consider, for example, an app that allows users to follow one another's activities in the app. In such an app, a function triggered by Realtime Database writes to store new followers could create Firebase Cloud Messaging (FCM) notifications to let the appropriate users know that they have gained new followers.
The function triggers on writes to the Realtime Database path where followers are stored.
The function composes a message to send via FCM.
FCM sends the notification message to the user's device.
To review working code, see Send FCM notifications.
Other interesting notification use cases
Send confirmation emails to users subscribing/unsubscribing to a newsletter.
Send a welcome email when a user completes signup.
Send an SMS confirmation when a user creates a new account.
I was trying to create a chat application using SendBirdSDK. But I couldn't find any methods in the documentation to start chat with a user. I downloaded the sample project and checked it, but it contains group channels and open channels only.
Is there any such methods to create 1 to 1 messages or should I need to create a groupchat with single user ID only?
Any help will be apreciated
According to the documentation,
A Group Channel is a private chat. A user may join the chat only through an invitation by another user who is already a member of the chatroom. A Group Channel can consist of one to hundreds of members. Creating a channel with two members allows 1-to-1 messaging.
So you just need to create a Group Channel with two User IDs in order it to be a 1-to-1 chat. Also, you should enable the Distinct property, because also according to the docs:
Consequently, we recommend that you enable the Distinct property in 1-to-1 messaging channels in order to reuse the same channel when a user chooses to directly message a friend. If the property is disabled, the user will create a new channel even if they have had previous conversations with the friend, and therefore will not be able to see or access previously sent messages or data.
Reference: https://docs.sendbird.com/ios#group_channel_3_creating_a_group_channel
I am not sure but in group channel they provide 1-on-1 messaging. But for that you need to create a group with other userID
You can use the reference code from here:
https://sendbird.gitbooks.io/how-to-build-an-ios-messaging-app/content/en/implement_1-on-1_messaging.html
How do i get chat history for Zoipm chat iOS SDKs, i am logging using anonymous user using default controller, is there any pre-config to be set to get this.
From an end-user's perspective, there is no way of seeing a chat history. Each chat is treated more like a ticket as it creates a ticket with the transcript upon completion. A chat transcript can be sent to the end-user.
I suppose the end-user could look through their ticket history and effectively see the chats alongside their other submitted tickets.