Appworld market link in Android runtime - blackberry-10

I have an app on the appworld and I would like to add a link to it in my app so that people can more easily rate it. Normally on the android market I would do something like:
Uri uri = Uri.parse("market://details?id=com.example.test");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
Or on Amazon I would do:
Uri uri = Uri.parse("http://www.amazon.com/gp/mas/dl/android?p=com.example.test");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
But when I try the following it does not work:
Uri uri = Uri.parse("appworld://content=000000");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
It pops up a browser and then I get a message about not being able to do it or something. I also tried to launch to the appworld website page but appworld isn't grabbing it. What would be to correct way to handle this link?

The normal market:// link should actually work.

The normal market:// URI didn't work for me. The BlackBerry World app would always show the error:
There was a problem loading this Page due to a network error.
The fix was to detect when my app was running on a BlackBerry device then to use a different URI:
if (java.lang.System.getProperty("os.name").equals("qnx")){
marketUri = "appworld://content/1234567"
} else {
//normal Google Play URI
}
You can get your content ID from the BlackBerry World Vendor Portal by clicking on the 'edit' link next to your app. The ID is shown in the first field.

Related

Access Blocked: authorisation error. flutter

I just released my first app and It has a button in it that takes you to a website.
A user just sent me this:.
I tried googling Google's secure browsers policy but not much info is coming up.
how can I make my app comply with this policy? I think the button opens a browser in app (I use duckduckgo as my default browser and haven't had an issue)
is it just a case of opening a browser and then heading to the website when the button is pressed?
my code to open the website is:
_launchURL() async {
const url = 'https://www.thiswebsite.com';
final uri = Uri.parse(url);
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
throw 'Could not launch $url';
}
}
thanks so much and any help would be greatly appreciated
Google is trying to make sure, you open this window in an actual new browser window, not in a webview still under the control of your application.
Your code should open an external browser.
Maybe the user has no browser installed on their device? Maybe their default browser is some exotic thing not recognized by Google?
If you are using the latest version of url_launcher (currently 6.1.8) there is not a lot more you can do.
You could force the app to take the external browser, not the in-app webview:
await launchUrl(_url,mode: LaunchMode.externalApplication);
But that should be what happens anyway. If your version is up to date, ask your user, what browser they use. Be prepared to tell them that they need to use another one.

Opening Google calendar from Flutter app (Deep Linking)

I want to open Google calendar app more specifically the create event page in the app from my another flutter app.
I am using the URL launcher package but it opens the app in chrome
What change should I make in the URL so that the add event page opens directly in the google calendar app.
Currently my URL looks like below
https://calendar.google.com/calendar/u/0/r/eventedit?dates=20210226T033000/20210226T040000&ctz=Asia/Calcutta&location&text=Blawsome:+A+Crystal+Alchemy+Healing+Meditation&details=Parth+Pitroda
My code for that part is as below
if (await canLaunchUrl(Uri.parse('https://calendar.google.com/calendar/u/0/r/eventedit?dates=20210226T033000/20210226T040000&ctz=Asia/Calcutta&location&text=Blawsome:+A+Crystal+Alchemy+Healing+Meditation&details=Parth+Pitroda'))) {
await launchUrl(
Uri.parse('https://calendar.google.com/calendar/u/0/r/eventedit?dates=20210226T033000/20210226T040000&ctz=Asia/Calcutta&location&text=Blawsome:+A+Crystal+Alchemy+Healing+Meditation&details=Parth+Pitroda'),
mode: LaunchMode.externalApplication);
} else {
throw 'Could not launch URL';
}
rathe than using a HTTP request, you could use googleapis package from https://pub.dev which has inbuilt methods to create Google Calender events directly within the Calender app.
Check package and documentation here.
Happy coding!

How to open Youtube app from another app after clicking a button with a query searched in youtube?

What should i define in my activity i.e Action, ActivityClass, ActivityPackage, ExtraKey and ExtraValue to define an intent in app to open Youtube app in and android phone to open with "ExtraValue" searched in youtube?
I am trying the following combination but getting Error 601.
Action: android.intent.action.SEARCH
ActivityClass: com.google.android.youtube.WatchActivity
ActivityPackage: com.google.android.youtube
DataType:
DataUri:
ExtraKey: query
ExtraValue: app Inventor activity starter
ResultName:
use this on your project:
https://developers.google.com/youtube/android/player/downloads/
include this code in your onclick method:
Intent intent = YouTubeStandalonePlayer.createVideoIntent(getActivity(), api_key, video_id);
startActivity(intent);
api_key is the Google Console APIs developer key.
video_id is the code after v=, for example:fYWZNN4bbz8 in "https://www.youtube.com/watch?v=fYWZNN4bbz8"
:)

WP7 Facebook integration using C# SDK

I want my game player to able to post game score to his facebook wall from WP7 game. I have gone through following tutorials
1> Tutorial: Logging Into Facebook with Windows Phone 7 (Silverlight) (source code is downloaded from their website.)
PROBLEM: After running sample project, i can login to facebook, but can't figure out how to post the message.
2> I have download sample project from github.
PROBLEM: When i open the project for WP7, a window pop up saying "Solution folder are not supported in this version of application. solution folder '.nudget' will be displayed as unavailable."
I have tried downloading nuget updates as suggested by Prabir's Blog.
3> With this tutorial, i am able to login to facebook.
PROBLEM: unable to post any message. it display inside emulator "The remote server returned an error:NotFound".
please let me know if you find this question inappropriate or lack of research, i will romove question immediately.
I am novice to both WP7 and C#. Please help me to correct above problems.
Thanks in advance
EDIT : Finally got 3rd one working by making small changes in PGLogin.xaml.cs, just change "PRE" to "pre" in "wbLogin_LoadCompleted" method. but still not much satisfy. because its work and sometime don't. it's not stable. and don't know how to logout. any suggestion?
Another user had this exact issue, it was resolved using the following code:
var args = new Dictionary<string, object>();
args["name"] = "Check this out";
args["link"] = "www.xyz.com";
args["caption"] = "";
args["description"] = "description";
args["picture"] = "";
args["message"] = "Check this out";
args["actions"] = "";
FacebookAsyncCallback callBack = new FacebookAsyncCallback(this.postResult);
fbApp.PostAsync("me/feed", args, callBack);
private void postResult(FacebookAsyncResult asyncResult)
{
System.Diagnostics.Debug.WriteLine(asyncResult);
}
Post to Facebook wall using WP7 and Facebook.dll
ShareLinkTask shareLinkTask = new ShareLinkTask();
shareLinkTask.Title = "Divum Photo Browser";
shareLinkTask.LinkUri = new Uri(list_photos.ElementAt(index_).imageUrl, UriKind.Absolute);
shareLinkTask.Show();

mobile version of Facebook app going into redirect loop

I have developed a Facebook app using the C# SDK and it is working fine. Now I want to also enable it on mobiles, so I tried to set the "mobile url" to the same one as my canvas url (which is a cloudapp.net address). However, when I try to access it from a mobile, it seems to go into a redirect loop involving my canvas url, the apps.facebook url and the m.facebook/apps url. Sometimes it goes out of the loop and I get the facebook error message saying : "the mobile version of the app is unavailable because it is misconfigured. It appears to be caught in a redirect loop."
I think it may have to do with the fact that the facebooksettings in the webconfig file specify that my cloudapp page should redirect to the apps.facebook.com page, which then redirects to the mobile url and so on. Can someone tell me how to solve this problem - I just want my mobile url to be the same as my canvas url.
Thanks.
If the request is from mobile add extra logic
For v6,
var fb = new FacebookClient();
var desktopLoginUrl = fb.GetLoginUrl(new { .... });
var mobileLoginUrl = fb.GetLoginUrl(new { ...., mobile = true });
For v5,
var urlBuilder = new UrlBuilder(oauthClient.GetLoginUrl(...));
urlBuilder.Host = "m.facebook.com";
var loginUrl = urlBuilder.Uri;