DISQUS-API-Recipes
DISQUS-API-Recipes copied to clipboard
Integrating disqus in a mobile app
Hi,
I'm following your guide to display disqus comments on my Android app. It works fine for the most part as comments are being displayed nicely. However, I can't get the login flow to work whether it's via email or through any of the social media. The result is that my users can see the comments but cannot login or add any new comments.Anyone following this guide can easily reproduce this behaviour. I'm suspecting that the popup window that you now display on clicking Login doesn't play well with embedded webview. Any suggestions on how to solve this?
Same issue here... Any feedback please?
Hi @yiannistri and @jasonatt. Thank you for reporting this issues. There is indeed a problem with the login flow, which we became aware of recently. We have a fix that we're working on addressing in that documentation soon, likely this week. Apologies for the outdated documentation.
Hi, that was fast :)
Will you notify us via this thread or shall I subscribe somewhere?
Cheers
Yes :). I'll be sure to mark this issue as closed once we fix the documentation. Subscribing to this issue should be good. On Sun, Aug 21, 2016 at 8:48 AM Jason Attard [email protected] wrote:
Hi, that was fast :)
Will you notify us via this thread or shall I subscribe somewhere?
Cheers
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/disqus/DISQUS-API-Recipes/issues/22#issuecomment-241265037, or mute the thread https://github.com/notifications/unsubscribe-auth/AC0YKYjuyOSAFPIM7GPzc-m0s6dJfagQks5qiHM1gaJpZM4Ix7ml .
Cool Thanks
Hello @dmatt! I've to get Disqus integrated in my android application and for that I'm waiting for the new documentation. Any updates?
We'll have some updated instructions for android very soon (most likely this week), sorry for the wait. I'll be sure to update this Issue once we have more to share. On Tue, Aug 23, 2016 at 11:21 PM RamizSami [email protected] wrote:
Hello @dmatt https://github.com/dmatt! I've to get Disqus integrated in my android application and for that I'm waiting for the new documentation. Any updates?
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/disqus/DISQUS-API-Recipes/issues/22#issuecomment-241968586, or mute the thread https://github.com/notifications/unsubscribe-auth/AC0YKR-mhQtqQpj3Nkqs4rxMOvLw5qsDks5qi-L7gaJpZM4Ix7ml .
Having the same issue, not able to comment after navigating back to the comment thread url when a successful login is detected.
@dmatt any updates?
Yes, the mobile instructions are still a work in progress. Our developers have an updated Windows UWP example here https://github.com/ryanvalentin/disqus-install-examples/tree/master/windows-uwp. We will be adding iOS and android soon but no ETA yet. On Sun, Aug 28, 2016 at 11:23 PM RamizSami [email protected] wrote:
@dmatt https://github.com/dmatt any updates?
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/disqus/DISQUS-API-Recipes/issues/22#issuecomment-243041493, or mute the thread https://github.com/notifications/unsubscribe-auth/AC0YKbplxM9r3KW-Yf_twm3KvvTV04AJks5qknrmgaJpZM4Ix7ml .
I found that the issue doesn't exist in android 4.4.2, but android 5 and above still have the issue.
@dmatt Hello, Is there going to be Javascript documentation for this? I've had a look through the windows documentation and each time I'm trying to sign in I'm not seeing any of these url endings "#!auth%3Acancel", "#!auth%3Asuccess", #!auth%3Afail" to be able to redirect anywhere, it's just sticking on the auth start one, but if I restart the app I will be signed in. I'd love to get this working asap as I've spent a good few days on it now.
Hi, I can confirm taml issue. I have a cordova build of the app and on ios I can see the ending urls and all work fine but on android does not detect them so cannot redirect.
Hey @jasonatt have you managed to get the redirects working on iOS? I'm building a Ionic / Cordova App too! It would be good to compare code to see how you've implemented Disqus as I'm getting Disqus to show the right comments for the right posts 98% of the time ( for some reason it's not bringing the right ones in on two posts) but haven't managed to get anywhere at all with the redirects!
Hi @taml,
I am using the in app browser and listen to when the page finishes loading to detect the url and redirect based on that. Perhaps @dmatt can assist as I think the paths are different on android...
$scope.disqusUrl = "Your Url of the starting page"
$scope.disqusUrlCall = function(url) {
var ref = cordova.InAppBrowser.open(encodeURI($scope.disqusPushUrl), '_blank', 'location=no', clearsessioncache="yes", clearcache="yes");
ref.addEventListener('loadstop', checkUrl);
};
function checkUrl(params) {
//console.log(params.url);
if (params.url.indexOf("disqus.com/next/login-success") > -1 || params.url.indexOf("disqus.com/_ax/facebook/complete") > -1 || params.url.indexOf("disqus.com/_ax/google/complete") > -1 || params.url.indexOf("disqus.com/_ax/twitter/complete") > -1) {
//alert("Redirect from Disqus");
cordova.InAppBrowser.open(encodeURI($scope.disqusUrl), '_blank', 'location=no');
}
}
Hi @jasonatt Thanks for sharing your code. Where are you putting that code? At the moment I have this in my controllers.js file `$scope.showComments = function (postid, posttitle, posturl) {
var disqus_identifier = postid;
var disqus_title = posttitle;
var disqus_url = posturl;
var url = "views/app/disqus.html?";
$scope.disqusurl = url + "shortname=mysiteshortname&url=" + encodeURIComponent(disqus_url) +
"&title=" + encodeURIComponent(disqus_title) + "&identifier=" + encodeURIComponent(disqus_identifier);
$scope.disqusurl = $sce.trustAsResourceUrl($scope.disqusurl);
}; ` I'm also using a directive linked to the Cordova in app browser so I can target a specific link to open in the in app browser by calling it in a
Hi,
Its in a controller. I have a button for the user to open the in app browser with disqus by calling the disqusUrlCall function.
However my url is located from the server as I have the disqus script running from there so I basically send the parameters to the server and show the comments page via inapp browser. its the only way i found to work properly.
@dmatt any updates?
Thanks
So it sounds like we would also need instructions on how to put Disqus on a Ionic/Cordova app as well. I can look into that, but I'm not exactly sure what the pitfalls are off the top of my head.
The main issue I found it that after the user logs in I cannot redirect them on Android. It works on ios however.
@ryanvalentin Instructions for Ionic / Cordova would be so helpful!
Hey @ryanvalentin , any news on how to add disqus on a Cordova app?
Are there any plans for this? I 'd like to know cause we can wait and release our app with the disqus commenting system, only if it's in your immediate plans...
Thanks!
@taml @georgekosmidis I have disqus working (login/out/comment) with a purely javascript implementation on android. What problems are you all having, I might be able to help out.
For those on iOS that found this broken, the key url to watch out for is "https://disqus.com/next/login/?forum=myforumname#!auth%3Astart" If you were reloading the comments after login success and waiting for "https://disqus.com/next/login/?forum=myforumname" That won't work anymore. I had to specifically make sure the auth%3Astart one went through without reloading the comments again for it to work.
Has anyone tried to implement this to ionic 2 / angular 2?
@Brle88 http://stackoverflow.com/questions/36102556/is-this-the-right-way-to-embed-disqus-in-angular2-component maybe this can help you
@MaxTimothy can you help me with an example(repo or code) , how you are handling the login with disqus in a hybrid app
@dmatt any updates?
Thanks
@correasebastian Show me some code so I can see what you've tried/doing and I'll see if I can help, but with out it I have no way of knowing what's going on in your program.
@MaxTimothy thanks for you answer,
Im using
Cordova CLI: 6.4.0
Gulp version: CLI version 3.9.1
testing on android 5.1.0 this is my code
var disqusUrl = 'https://kyky.localtunnel.me/?shortname=ufwtest&url=https://ufw-app-staging.herokuapp.com/&title=third';
var inAppCall;
function disqusUrlCall() {
var options = "location=yes,clearsessioncache=yes,clearcache=yes"
inAppCall = cordova.InAppBrowser.open(encodeURI(disqusUrl), '_blank', options);
inAppCall.addEventListener('loadstop', checkUrl);
};
function checkUrl(params) {
//console.log(params.url);
if (params.url.indexOf("disqus.com/next/login-success") > -1 || params.url.indexOf("disqus.com/_ax/facebook/complete") > -1 || params.url.indexOf("disqus.com/_ax/google/complete") > -1 || params.url.indexOf("disqus.com/_ax/twitter/complete") > -1) {
// inAppCall.removeEventListener('loadstop', checkUrl);
/*
// first attemp: this does not work, after openning ask for login again
cordova.InAppBrowser.open(encodeURI(disqusUrl), '_blank', 'location=no');
*/
/*
// second attemp: this does not work, after redirecting ask for login again
var script = 'window.location="' + disqusUrl + '"';
debugger;
inAppCall.executeScript({
code: script
}, function(params) {
console.log('script execute successfully', params)
})
*/
}
}
disqusUrlCall()
this is the path:
-
Open inappbrowser and load the disqus embed
-
i click login, and succesfully logged in
-
redirect to the disqus forum ( but is not logged in)
any help will be appreciate