Need to tell users when update occurs - xamarin

I want to notify all the app users to update the app (through a popup in the app itself) whenever there is a new version deployed in the stores. Can someone suggest the best way to do that?

Luckily, we do have solution for iOS app store
string url = "http://itunes.apple.com/lookup?bundleId=com.xxx.xxxxx";
HttpClient httpClient = new HttpClient();
Task<string> jsonString = httpClient.GetStringAsync(string.Format(
var lookup = JsonConvert.DeserializeObject<Dictionary<string, object>>(jsonString.Result);
But Now I need to get the current version of App from Google Play Store?

Let's say you want to notify the users about a new version of the app every time they open the application, then you should just trigger a simple GET call to retrieve the latest version info or use a third party lib to act accordingly.
0 cost simple solutions
One option would be to ask the API (if there is any) if a new version is available - basically delegate the problem to someone else. If there is no backend the app could do the check itself. There are different options from having a simple txt file hosted somewhere with the latest app version to scraping App Store and Play Store for the current published version of the app.
Existing solutions
https://appgrades.io/
https://github.com/ArtSabintsev/Siren
Use Push Notifications to notify your users
You will find more if you google it
Platform specific solutions
For iStuff (Apple) you could use iTunes Search API as mentioned here
Other platforms may have their own APIs
Depends on the specific case you can decide what will work better for you.
P.S.: Be sure to handle the versioning correctly by bumping the app version on each release.

Related

Questions about [#slack/bolt] package for configuring for Redistribution to make available for multiple workspaces

Looking to see if anyone could point me to any documentation on if Bolt [#slack/bolt] is configurable for using with multiple workspaces? I am currently utilizing the Slack Bolt NPM package SDK to develop a Slack App, and have it working for a single workspace - but now I want to make it available for multiple workspaces. I have it currently configured in the API settings for allowing Redistribution, but not understanding what needs to be done inside the App to enable the App to pick up event(s) triggered across multiple workspaces from the App.
I only seem to be able to make it work with 1 single workspace at a time.
I have scoured all available sources but can't find anything that can point me to the right direction. I feel like there is something that I am not understanding or if it isn't a possibility with Bolt...
Development environment (NodeJS), working with the [Slack Bolt SDK from Slack]
Do things change for how you configure the client for a redistributable app? (no longer passing in the signingSecret and token), and having to be initialized a different way? I feel like I am missing something. Can anyone point me to some documentation on how this is accomplished for making the app functional for multiple workspaces with the Bolt framework (if it is). Or point me to a project with existing implementation of a project that currently exists as an example.
Thank you, I appreciate any help/feedback.
Does that requirere that new individual app instances of the app would need to be setup and running for each workspace (one app can’t handle all workspaces). Also does that mean that a new app has to be setup for each workspace so it can be configured with where to point to for it’s event handlers? I was initially thinking that a single app could be the central app to handle multiple workspaces - and that additional work spaces would be able to add the app from the ‘Add Slack App’ button from the Redistribution settings of the single app.
I do currently have it setup to pull in and store the additional workspaces IDs and tokens and initializing them through the app const values (but having to setup each one as it own individual running app per workspace. But the big issue I am having is that the redistribution settings for the API only seem to let you specify 1 App endpoint to direct events to, but each app is setup as it’s own app in this pattern (so I would need to have 1 for each)
If you build using the OAuth examples here, then it will work across multiple workspaces using a single instance of the app.
Instantiating the app would look like this in your code -
const app = new App({
signingSecret: process.env.SLACK_SIGNING_SECRET,
clientId: process.env.SLACK_CLIENT_ID,
clientSecret: process.env.SLACK_CLIENT_SECRET,
stateSecret: 'my-state-secret',
scopes: ['channels:read', 'groups:read', 'channels:manage', 'chat:write', 'incoming-webhook'],
installationStore: {
storeInstallation: async (installation) => {
// change the line below so it saves to your database
return await database.set(installation.team.id, installation);
},
fetchInstallation: async (InstallQuery) => {
// change the line below so it fetches from your database
return await database.get(InstallQuery.teamId);
},
storeOrgInstallation: async (installation) => {
// include this method if you want your app to support org wide installations
// change the line below so it saves to your database
return await database.set(installation.enterprise.id, installation);
},
fetchOrgInstallation: async (InstallQuery) => {
// include this method if you want your app to support org wide installations
// change the line below so it fetches from your database
return await database.get(InstallQuery.enterpriseId);
},
},
});
One App ID === One instance, which can be installed on multiple workspaces once you activate public distribution.

Receive notification back from Xamarin Forms Maps

I have a Xamarin Forms app that, during it's execution, launches the Maps plugin (from the Essentials package). Here's the code that I use to launch the maps:
var location = new Location(latitude, longitude);
var options = new MapLaunchOptions
{
NavigationMode = NavigationMode.Driving
};
await Map.OpenAsync(location, options);
However, since I want the user to be directed to a location, I want to know when they get there; the idea being that some events occur within the app when the user arrives.
It looks, to me, like the Maps plug-in doesn't provide any kind of notification.
I've been through a few iterations of this. Initially, I thought of using the Geolocator to identify when the user arrives, then had a look at a Geofencing plug-in that I found.
Before I head down either of these rabbit holes: is it possible to get the Maps plug-in to tell me when the user arrives at a location.
It is possible by Creating the Custom Map to realize it in each platform.
You can create a Timer Task in Background service to execute getting current location from Geolocator (not a plugin).Then when current location is detination , message can be passed to where you want to do.
By the way , about native framework in each platform . There are some methods like UpdateLocation can be directly used to know the current location .
Such as :
IOS has startUpdatingLocation method to listen the current location.
Android has onLocationChanged method to know the current location if changed.
What need to do is to notification the user he has arrived the detination when the current position enters the range .

azure media service for xamarin?

I have created a console application with azure media service.
in the app i am using the plugin
windowsazure.mediaservices
the way i am doing is
static IAsset CreateAssetAndUploadSingleFile(string filePath, string assetName, AssetCreationOptions options)
{
IAsset asset = _context.Assets.Create(assetName, options);
var assetFile = asset.AssetFiles.Create(Path.GetFileName(filePath));
assetFile.Upload(filePath);
return asset;
}
so i just want to know whether this plugin will work on xamarin(i am not a xamarin devoloper) as its a portable project.
if its not do we have any alternative plugin?
my basic purpose is upload and encode.
That package is for our current .NET SDK
https://www.nuget.org/packages/windowsazure.mediaservices
It does not support .NET Core. See the dependencies.
It's not compiled for Xamarin though, so I don't believe that it works in Xamarin, but i'm not a Xamarin expert at all.
What is your scenario exactly? Why would you want to call the Media Services account directly from Xamarin anyways? You would only need to do that if you are creating a management application for the account Administrator. Otherwise, dont put Media Services directly into any client code! You should hide it in your middle-tier, and only pass Streaming URLs or SAS locators to the client application to upload content to.
For the upload from phone scenario, middle tier should create an Asset, get a writable SAS Locator for the Asset, hand that to the client side. Client can then use Azure Storage APIs to upload the content to that SAS URL directly (it ends up in an Azure storage container then.)
I believe that Xamarin has client side support for the Azure Storage APIs available.
As john answered, you don't do this stuff on a client, you will need to use SaS tokens and what not. I could explain everything here, but there are some nice guides and examples online.
Build 2018 video explaining how it works (including Azure Functions): https://www.youtube.com/watch?v=dEZkQNNpSIQ&feature=youtu.be&rel=0
The github example of this video: https://github.com/Azure-Samples/xamarin-azure-businessreview
To understand it better, I recommend this guide, it is old but it does cover the entire process, just make sure to combine new documentation with this old one.
Old docu: https://learn.microsoft.com/en-us/previous-versions/msp-n-p/dn735912(v%3dpandp.10)
Official current documentation: https://learn.microsoft.com/en-us/azure/media-services/previous/media-services-dotnet-upload-files#upload-multiple-files-with-media-services-net-sdk
Probably useful for new readers.

How to get app version (Play / iTunes) stores using Codename one

How do I get published apps version number from Google Play store and Apple App Store with App ID?
Is there any Rest API to provide apps version on stores?.
You can't get the store version but your own version, the version number you put in before submitting the app to stores.
Use Display.getInstance().getProperty("AppVersion", "1.0")
To change your version number, right-click the app and select properties then change the Version number as necessary. The version you put in will be returned whenever you call the above line.

NSURLSession with share extension returns -995 on OSX

I'm trying to upload data using NSURLSession with a background task from an OSX share extension.
As soon as I start the task, by delegate is called back with the world's least helpful error message:
The operation couldn’t be completed. (NSURLErrorDomain error -995.)
There's no other information in the NSError object, nor in the console.
After scouring the internet, the only clue I have is to make sure that I've set up the configuration.sharedContainerIdentifier correctly, however I've already done that:
let configuration = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier(uniqueId)
configuration.sharedContainerIdentifier = Config.appGroupName
urlSession = NSURLSession.init(configuration: configuration, delegate: self, delegateQueue: nil)
I then prepare the request and create the task:
let task = self.urlSession!.dataTaskWithRequest(request)
self.tasks.append(task)
task.resume()
Note that everything works perfectly when from my main app. It's just the sharing extension that fails.
What other problems could cause error -995?
(Bear with me, I don't have rep yet for a comment so I have to answer, and notwithstanding the possibility you've found a bug, the last part I'm adding might help others)
When you're using an NSURLSession any background upload/download that completes will launch your main application. This is detailed in the Common Scenarios page.
As you show you've done, you need to set the NSURLSessionConfiguration with a sharedContainerIdentifier:
let configuration = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier(uniqueId)
configuration.sharedContainerIdentifier = Config.appGroupName
urlSession = NSURLSession.init(configuration: configuration, delegate: self, delegateQueue: nil)
You also need to ensure that both your app extension and your main app are all triple-checked in the 'App Groups' option in Xcode (I'm looking at Xcode 8.1), which means:
The app group name is the same for both app and extension(!)
the check beside Add the App Group entitlements in the entitlement file
the check beside Add the App Groups feature to your App ID
the check beside Add App Groups to your App ID
And the checks need to be there on both app and extension.
I'm a bit rusty on adding these but my recollection is these aren't listed in the right order, e.g. you have to 'Add App Groups to your ID' before you can check them in both app and extension, but I could be wrong.
Advanced - Thirdparty libraries in app extensions.
Looking at the github project nst/STTwitter, a third-party Twitter REST library, they needed to add a configurable group ID to allow setting the NSURLSessionConfiguration sharedContainerIdentifier to the library user's group ID.
I may again be mistaken but this seems like it would be a general problem when using thirdparty libraries in an app extension - e.g. I've just now come across this error when trying to use the ChromeCast SDK and this could be the kick in the pants.

Resources