QuickBlox sample video chat Unauthorized Error - ios

I am trying to run the Quickblox Video Chat sample to see if this is something that can be integrated to my app, but the sample setup is incomplete in how to get it to work.
https://github.com/QuickBlox/Sample-VideoChat-ios
I have created an app, put my app keys in the sample, and created 2 users and put their information there, but still does not work.
Please, when you put sample code write ALL the information you need to get it to work. The read me file mentions nothing about having to setup new users and even I figured this out, it still does not authenticate, just giving the error "Unauthorized"
This is the code they have for the users:
// This is test oppoents. This is 2 users' logins/passwords & ids
self.testOpponents = #[#"videoChatUser1", #65421,
#"videoChatUser2", #65422];
I created my own users in my registered Quickblox app and replaced the above code, but it still does not work. Is the password information supposed to go someplace here???? What is causing this to fail???

If you quickly go through whole sample, you can see some comments there
for example, look at this file
https://github.com/QuickBlox/Sample-VideoChat-ios/blob/master/VideoChat-sample-ios/AppDelegate.m
you can see comments that explain what all these values mean
//
// There are tests oppoents. There are 2 users' logins/passwords & ids
//
self.testOpponents = #[#"videoChatUser1", #65421,
#"videoChatUser2", #65422];
videoChatUser1 - login and password of the 1st user,
65421 - ID of the 1st user
videoChatUser2 - login and password of the 2nd user,
65421 - ID of the 2nd user
hope this help

Related

Zapier: How to send data to my Node.js web app from ScheduleOnce using Zapier

Here is my workflow:
Person clicks on my ScheduleOnce link and schedules a meeting
Upon completing the ScheduleOnce booking form, the person clicks the done button
When this done button is clicked the person is redirected to a Node JS web app that displays an application page. This application page needs to be auto-populated with the information from the ScheduleOnce page.
Between step 2 and 3 is where Zapier comes in. I am trying to use Zapier to capture the data from the ScheduleOnce booking, which it is. Then I am trying to use a Zap to send that data to the page the person is redirected to, to auto-populate some of the fields.
I thought using the Code Javascript functionality would work but it does not. So then I was thinking about using the StoreClient option or the API. I am just confused on how to get the flow to work to access the data and auto-populate the fields on the next redirected page.
Some help would be greatly appreciated.
Here is the code I have for the Javascript option:
var store = StoreClient("Secret");
store
.setMany({firstName: inputData.firstName, lastName: inputData.lastName, email: inputData.email, mobilePhone: inputData.mobilePhone, otherPhone: inputData.otherPhone, businessWebsite: inputData.businessWebsite})
.then(function() {
return store.getMany('firstName', 'lastName', 'email', 'mobilePhone', 'otherPhone', 'businessWebsite');
})
.then(function() {
callback();
})
.catch(callback);
David here, from the Zapier Platform team. This is a cool use case and is probably possible. Something you need to remember is that Zapier is running totally separately from the user, so interaction will have to be indirect. Zapier can't redirect your user anywhere, it can just store data in response to a button push.
In your case you can skip everything after the setMany, since you're not trying to use the values in the zap; you just need to store them (and verify that action completed without errors).
var store = StoreClient("Secret");
store
.setMany({firstName: inputData.firstName, lastName: inputData.lastName, email: inputData.email, mobilePhone: inputData.mobilePhone, otherPhone: inputData.otherPhone, businessWebsite: inputData.businessWebsite})
.catch(callback);
You'll need to solve a couple of problems:
Speed. the user will reach your landing page before the zap completes (as it has to make a couple of HTTP round trips and execute code). You'll want to play them a 3 second loading gif, or put a waiting message and allow them to refresh the destination
Populating the page. I'm not sure what the nature of the destination is (best case scenario is that it's a server you control), but something will need to make an http request to store.zapier.com to retrieve the stored data and surface it in the view. This is easy if
Identifying the user. You'll need some way to identify the user getting redirected to the data you stored in StoreClient. If two users fill out the form in quick succession, the second one will currently overwrite the first. Plus, it seems to be semi-sensitive data that you don't just want available to anyone on your site. To that end, you'll probably want to store all of the data as a JSON string keyed by the user's email (or something else unique). That way, when I (the user) finish the form, I'm redirected to yoursite.com/landing?email=david#zapier.com, the backend knows to look for (the david#zapier.com key in store) and can render a view with the correct info.
To that end, I'd tweak the code to the following:
var store = StoreClient("Secret");
store
.set(inputData.email, JSON.stringify({firstName: inputData.firstName, lastName: inputData.lastName, email: inputData.email, mobilePhone: inputData.mobilePhone, otherPhone: inputData.otherPhone, businessWebsite: inputData.businessWebsite}))
.catch(callback);
Hope that points you in the right direction. You're working with a pretty complicated workflow, but I bet you can do it!

Parse and Swift: How use advance targeting push to specific devices without users?

I currently creating an app where the users can add a posting without logging into the app or using any credentials.
Other users of the app can open the app and directly comment on the posts(the comments are an array of the post object).
I read the parse docs and I believe that this will use advance targeting. I saw PFInstallation.currentInstallation() for advanced targeting but I believe that is based on the users class and I am not using the Parse.com users class
What I would like to do is to send a push notification to the original poster when a comment is added to their post... So, I was wondering how I would go completing that?
Thanks!
It couldn't be easier,
Installation has a "user" column. Just make a query that matches the "user" of interest. So, your code will look something like this....
if ( .. comment made, need to send a push .. )
{
console.log(">>> 'comment' was added....");
var query = new Parse.Query(Parse.Installation);
query.equalTo('user', .. whoWroteThePost .. );
alert = "Wow! You have a new comment on a post you wrote!!!";
Parse.Push.send(
{
where:query,
data:{ alert: alert, badge: "Increment" }
});
return;
}
Note that you said ...
"What I would like to do is to send a push notification to the original poster when a comment is added to their post... "
In that sentence you speak of the "original poster". So, that's going to be a variable like originalPoster. So this line of code
query.equalTo('user', .. whoWroteThePost .. );
will be
query.equalTo('user', originalPoster );
Note that this is extremely common, and you can find endless examples on the web! Here's just one: example
Note that:
Parse's term "advanced targeting" is very confusing.
To phrase the same thought another way,
Parse's 'channels' are just silly, ignore them.
That is to say, simply ignore the "channels" nonsense, and just search on users. It's easier and less confusing than the channels business, which is just an extra field you have to fill-out al the time.
It's just one of those weird things about Parse.
I've never used the "non-advanced targeting" - it's stupid and pointless. And the "advanced" targeting is trivial to use: assuming you can write cloud code at all you can do "advanced" targeting. If you can write a query in cloud code, you can do "advanced" targeting.
Essentially,
query.equalTo('user', .. whoWroteThePost .. );
Note that, of course, you may have to first look up who wrote the post, and then from there you can make the query for the Push.
Note, in this process it makes:
no difference at all if the user is anonymous.
You can and should go ahead and send pushes, in the same way.
Advanced targeting is not done against users. It's just that is the easiest way to show an example.
You need to store the installation against the objects you want to push to. So in this case store the installation against the post. Then when the comment comes in you can send a notification to the installation connected to the post it relates to.
I think you are looking something called anonymous users. There is almost impossible to send notification without user's data. But, Parse.com provides something called anonymous users so that app users are not necessary to sign up in order to fully function something user related operations.
Then, you will need to store some information in order to find the target.
Parse.com Anonymous Users

How to best manage twitter avatars?

Twitter users can login and post comments on my site, as well as new posts.
Now, i am storing the user ID on my comments table on the database.
I was wondering what is the best practice to get users avatar and show it anywhere.
I guess that using the API is not the best option as it has a rate limit of 150/hour or 350/hour if OAuth is used.
Then i thought about getting it with this little code:
<?php
$username = "twitter"; // <-- You did not use quotes here?! Typo?
$xml = simplexml_load_file("http://twitter.com/users/".$username.".xml");
echo $xml->profile_image_url; // <-- No $xml->user here!
?>
But if i have to show, let's say, 20 avatars on one same page, maybe there will be a little delay getting all of them.
I also thought about storing them on the database on a users table with the nick and so on. But then... what if the user updates his profile picture? I would still having the old one...
So, what is the best practice for it?
There are many pages and systems with have to deal with same problems such as pinterest.com, or liveFyre comment system, disqus...
Thanks
I would say that you need to store the avatar URL generated by twitter and use that without calling the API everytime. Or use this service http://tweetimag.es/

I would like to add with tags when POSTing to Facebook from an iOS app

I have successfully posted now. I have successfully set the privacy params and they work fine. Next, I would like to be able to add people tags like you can do in the Facebook website, where it adds to your message such as: with Bill Smith and Joe Blow. I've read the documentation on Post's. There it includes an item called message_tags, but that seems to refer to a location in the message. So, I created a message on the FB website on my wall where I added a couple of friends and the message has the 'with x and y' on the screen. Then, in my app, I downloaded my posts to see what they looked like in the logging view. No message_tags, but two other places, 'to' and 'with_tags' have the friends there. So, I modified my posting code to use each of these and even tried using both. They post with no error, but viewing on the FB website, no mention of the friends.
When I download these posts using my app, no mention of 'to' or 'message_tags' or 'with_tags'.
Any help would be appreciated.
In addition, I have tried to specify a place in the params. I used data taken from a post which I created on the FB website and downloaded into my app, so the data should be valid. Here is the JSON:
place = "{\"id\":\"171321908789\",\"name\":\"City O City\",\"location\":{\"street\":\"206 E. 13th Ave.\",\"longitude\":\"-104.9845\",\"latitude\":\"39.7367\",\"zip\":\"80203\"}}";
When I include this for key: place, I get this:
0 : {contents = "message"} = {contents = "(#100) {"id":"171321908789","name":"City O City","location":{"street":"206 E. 13th Ave.","longitude":"-104.9845","latitude":"39.7367","zip":"80203"}} does not resolve to a valid user ID"}
To post
Hi -- in PLACE with FRIEND1 and FRIEND2
you only need the ids of the place and friends. Try the following parameters :
message : "Hi",
place : "PLACE-id",
tags : "FRIEND1-id, FRIEND2-id"
It works for me in the graph explorer (
http://developers.facebook.com/tools/explorer) with the publish_actions permissions, when I post to https://graph.facebook.com/ME-id/feed
Hope it helps some people and is not too late for you.
A.

Set up multiple Facebook applications in one solution and fan page tap url problem

I have looked and searched for an answer for that question and I found an answer in Nathan Totten blog you can find the answer here:
https://gist.github.com/820881
The problem is I am trying to get the application settings according to the application which the user uses, which comes from the url by seeing your app name or id if you were in fan page.
It works with me within the user profile context by using:
var CurrentUrl = HttpContext.Current.Request.UrlReferrer;
and i can get the application name but within facebook fan page when using the same way it gives me a strange url :
http://static.ak.facebook.com/platform/page_proxy.php?v=4
However, it is supposed to give me:
http://www.facebook.com/pages/Mypagename/130736200342432?sk=app_myappId
Any help will be great and any new way to get which app id or tap url the user clicked will be even better.
this problem was exist within the user profile before ,and i think that you use the ifacebookapplication current method that will not give you the chance to get any thing about the context it only take you to an infinite loop ,i think that you have to send to Nathan Totten him self may be he has an answer because in the article he mentioned :
private IFacebookApplication GetCurrent()
{
var url = HttpContext.Current.Request.Url;
// Get the settings based on the url or whatever
var simpleApp = new DefaultFacebookApplication();
// Set the settings
return simpleApp;
}
may be he has a way to get the url within fan page or another way which i am sure it is not exist at least in my mind now .
Thanks ,I found an answer to my case :) now i can get my application id the way is i have to applications i try to decode the sign request with the app secret of each one if the decode result was clear then it is my target app if not then i will try the other one

Resources