I am inviting parties into a call using
await graphClient.Communications.Calls["{call-id}"].Participants
.Invite(participants,clientContext)
.Request()
.PostAsync();
as shown here
https://learn.microsoft.com/en-us/graph/api/participant-invite?view=graph-rest-1.0&tabs=csharp
This works fine, and I am able to detect responses from the invited party : Accept, Decline and Timeout via the callbacks.
However what I would like to do is to be able to cancel the invitation before the callee picks it up.
I assumed that the Delete primitive would allow me to do this,
https://learn.microsoft.com/en-us/graph/api/participant-delete?view=graph-rest-1.0&tabs=csharp
but at this point in the sequence, I do not have a participant ID for the invited party because it is not yet in the call.
So. My question is, how can I cancel an invitation after it has been issued ?
Thanks
Adding answer from comment section for more visibility.
There doesn't seems to be any graph API available to cancel an Invited participant.
Could you please raise an user voice here:
https://feedbackportal.microsoft.com/feedback/forum/ad198462-1c1c-ec11-b6e7-0022481f8472
Related
I am working on group chat using robbiehanson/XMPPFramework. I have done sending invitation,accepting invitation and messaging in group chat.
Here I want to show some information of user who sent message in group chat including his avatar.
I can get the users information from XMPPUserCoreDataStorageObject. this case is applicable only if those users are present in my friend list. I need to get the users information who are not in my friend list. Is there any possible way to achieve this. Please suggest me
In XMPP, avatar (vcard) of any user can be fetched irrespective of roster entries. So if you are trying to query vcard of any other user of your service, then it should work. If it's not working, please provide the both "get" and "result" IQ here for vcard request.
However, if you are trying to query presence status of other user's then yes there is restriction of roster. This can be overcome by implementing following logic:
User registers in your application (Android or iPhone), determine registered contacts of your service from user contact book and automatically add them in your roster.
Also Implement roster request handling in your application that when it get's request for allowing other user to add you in his roster, automatically accept the request and send request to that user to add him in your roster too.
Now again accept that request.
In this way, you can add users in roster behind the scenes and user's can view the information of other users just like WhatsApp.
I want to disable push notifications to user who has still not accepted the request for the group.
Note
This answer is valid as per my experience with quickblox framework 2.7 and below. As quickblox is releasing newer version's of framework very frequently you might find a better API for doing it in future. Till then you can make use of this approach.
Answer
I dont think you can disable push notification for a specific user in group using Quickblox api.
When you send a message (QBChat) to a group everyone in the QBChatDialog gets the message including the person who is sending it out him/her self.
There is a Privacy List to prevent the user from receiving message from specific users, but that requires a initiation from user's end. So I dont think that will help you much here. This feature can be used to block a person/group from sending message to user.
Solution
Your best bet would be, not to add the user to group until the user accepts the group request. Implement your own logic to send out the request to each user in group and keep adding the user when he/she accepts the request.
1> Send out QBChat message with a specific custom object with data like group id, group type, group name and all other necessary data, which will differentiate it from other QBChat messages to all the user in group.
2> On receiving this special message, show a UI specific to deal with it, like an alert with "would you like to join the group??" and button accept or deny
3> On tapping accept, make a WS call to your own server and in your server api add the user to specific group for which he has agreed to join.
Because you have already populated QBChat message with object which contains the info about the dialog, you should be able to inform your server easily for which group user has joined.
Once user joined to group he will continue to recieve all the messages in group
EDIT
Here is a detailed answer to your question in comment :)
I was pretty much sure you will ask this question :)
In order to add the occupant id to an existing QBChatDialog group we used the rest api of Quickblox. Remember I told you dont add all the participants to group initially, add them one by one after they accept to join group ?? When user accepts to join the group we call our rest api which in turn invokes the quickblox api and adds the current user id to group :)
You can easily find api for that in API section of quickblox. In case you din find it gimme time till Monday lemme ask my API developer and update u on the same
There is CATACH with this approach.
QB docs clearly says only the owner of the group can add the members to the group. That means just because you have a REST API you cant add the user to group. You will need to have the valid session id of the group owner. You will get the session id when you login, I believe you are very much aware of it :)
Now how on earth will I get the group owner session id ??
Here is the approach we followed. We had foreseen such issues might arise long way before we started the project :)
When user sign up using our app we save his username and password in our server db and generate a random username and password and create a Quickblox account with that usrname and password for the user and we save this quick blox username, quickblox password and quickblox user id for that user :)
So though sign up actually deals with two servers user will always feel like he is dealing with one server and he continue to think he is using his username and password to login to chat.
But in reality when user uses his username and password to login to app in login response we get the quickblox username and quickblox password that server had used to create the account. On receiving it app uses QB framework to login to quickblox account with that username and password :)
This way user is never aware of his quickblox username and password and userid :) Gives us lot of control as well :)
That being said :) now when a user creates a group and sends out a special QBChat message containing custom object, in that custom object along with details of dialog he also sends his quickbloxuserid :)
Now when user who recieves the special QBChat accepts the request, we extract the dialog id (to which he is intending to join) group_owner_id (id of user who created dialog and sent out this special message) and sends it to our rest api along with his own id :)
Once API recieves the group owner id, it fecthes the QB username and password from its db and log's in with that and gets a valid session id and finally adds the user to group with that session id.
Note : Quickblox allows user to login in multiple devices at a time that means it entertains multiple valid session id for user.
Hope I made my point clear :) Happy coding.
In fb-sdk 3.x. I was able to get request id after user has sent requests to their friends(usingFBWebDialogs) this way I could show in my app that user has invited friends which improved user experience because user got confirmation that invites were sent.
Now with fb-sdk 4.0(using FBSDKAppInviteDialog) I don't receive any data which would enable me to show invited friends.
Do you have any suggestions how to get list of invited friends?
There is no way to get list of invited friends.
The issue was discussed with Facebook engineer Emil Hesslow at Facebook Developer Community group. Here is relevant part of one of his comments:
And if they expect their friends to show up in the app it is just
because it was working like that before. Not because everyone always
assumes that will happen if you invite someone.
And no you can't get who they invited
My target is to invite friends to the app. The key point is to be aware of who sends the request for a certain user. There is no problem, if you invite someone who has an installed application. In such case you can use scheme URL and handle it properly via
application:openURL:sourceApplication:annotation:
But what to do, if the user has not the necessary app. Is it possible to implement a such workflow:
"Invitation link"->"Open appStore"->"Download app"->"Open app and elicit the sender's ID(or name)" ???
Maybe there is an another way how to do this. But my scenario implies invitation to the user's group. User sends request to his friend (Facebook,twitter etc.). But what to do, if his friend will sign up using not a Facebook account that you expect, but for instance his email address or twitter account or smth. else. In such case, I can't define, that this new user should be invited to the right group.
Sure, it is a possible way to include a notification in invitation message where you can ask the user to install the app before he will accept the invitation. But it seems to complex for user experience.
So, how to solve this problem ?
In other words:
If I build a deeplink to my app and send it to the user (to his email), but for some reason he would not have an installed app.
In such case I'd like to redirect user to AppStore and after he downloads the app, handle a previously sent request in method:
application:openURL:sourceApplication:annotation:
Is it possible to do this, 'cos I have not found the solution in documentation ?
Yes, you can do it using a third-party service called Branch. More info here.
Using the PayPal REST API, I cannot seem to figure out how to cancel a payment after a client clicks the "Cancel order and return to website" link. Perhaps in production mode PayPal cancels these payments automatically, but in sandbox mode they seem to stay in the "created" state.
That observation lead me to believe that I need to programmatically cancel each payment upon return to the website's "cancel_url" page. However, I cannot seem to find a cancel function in the PayPal REST API documentation.
https://developer.paypal.com/docs/api/
For what it's worth, I'm using the Ruby API.
I have been in contact with PayPal's technical support last week and this is what they said:
If the buyer has completed the work on the PayPal checkout page
without cancelling the checkout, then they are redirected back to your
site. If you wish for them to have a cancellation at that point, you
can build the Return URL to have a final confirmation (showing final
total to be billed). So at this point the buyer is on your site, but
the payment execution has not happened. If the buyer decides to
proceed, then you run the execute command, updating your database with
the successful payment details. If the buyer decides to cancel at
that point, you do not run the execute command, and purge the payment
ID and the buyer's Payer ID. There would be no request that you would
need to pass to PayPal to cancel what the buyer did on PayPal. This
would be the same type of process done with the Classic APIs using
Express Checkout. Once the buyer gets sent over to PayPal, they
choose the funding source and shipping address and get sent back to
your site, if they want to cancel the transaction, your site does not
send any API call to PayPal to cancel or void the EC token. It is
just not used to collect the payment.
When asked how to handle non-executed payments and if they automatically void non-executed payments after a certain amount of time:
Yes, I recommend deleting the Payment ID from your database, so there
is no accidental payment. Our system, by default, will expire the
payment approval made by PayPal payers if the payment hasn't been
executed within 3 hours.
Permission has been given by PayPal to post their answer here.
I actually talked directly with someone from PayPal. The answer was:
Once a user authorized a sale, the sale has to be executed. It cannot be canceled
past beyond that point. So if the user comes back on your return URL, you are
simply expected to run an "execute" command on your payment.
This may not directly apply to your case. I think that the only way to "cancel" would be to first "execute", then apply a full "refund". Otherwise, never execute (which I also view as strange because that looks like a potential for security problems. That said, the main problem that could happen is an "execute" on the payment and your company would receive the money that you can then manually refund if necessary...)
I think you need to void the authorization of the payment:
https://developer.paypal.com/docs/api/#void-an-authorization
I used paypal api v2, and there is cancel order api.
https://developer.paypal.com/docs/api/orders/v1/?mark=cancel%20order#orders_cancel