Base solution for your next web application
Open Closed

deploying mobile app #5346


User avatar
0
avanekar02 created

Hello

i have created a xamarin app, i want to deploy this for public access, but at the same time i also want to host the web.mvc project as the data shall be managed by another admin team, so please do you have a doc that shows clearly how to deploy these 2 apps .

as web.mvc will run on iis,

request you to assist me on this as i need to test the project after hosting.

regards Anwar


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    We only have this document <a class="postlink" href="https://aspnetzero.com/Documents/Development-Guide-Xamarin#distribution">https://aspnetzero.com/Documents/Develo ... stribution</a> for mobile app. And this one for ASP.NET Core MVC app <a class="postlink" href="https://aspnetzero.com/Documents/Step-by-step-publish-to-azure-core-mvc">https://aspnetzero.com/Documents/Step-b ... e-core-mvc</a>.

    You have asked a similar question before I guess. So, in which part are you having problem ? Maybe we can help you with that.

  • User Avatar
    0
    avanekar02 created

    you suggested using a domain name where do i need to put the domain name so that the mobile app access the code of the proxyservice. and the app is deployed on iis the web.mvc.

    thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    @avanekar02 you can use a domain name or a public IP address, both can work. But it is outside of AspNet Zero's support scope. You need to publish your app to IIS and configure it to be accessible by a domain name or a public IP address. You can search it on the web. It is not different then hosting a public website with a domain (or IP address).

  • User Avatar
    0
    alper created
    Support Team

    <ins>PUBLISH MVC</ins> 1- Open CMD and navigate to the MVC folder. Then run the below command to bundle your resource

    npm run create-bundles
    

    2- Right click the MVC project and click publish. Don't forget to copy your settings fromappsettings.json to appsettings.production.json and appsettings.Staging.json

    3-To be able to run the MVC project the server has to be installed**.NET CORE Runtime for Windows** <a class="postlink" href="https://www.microsoft.com/net/download/thank-you/dotnet-runtime-2.0.6-windows-hosting-bundle-installer">https://www.microsoft.com/net/download/ ... -installer</a>

    4-Add your website to the IIS as a new website by right clicking "Site" node and choose "Add Website". Assign a port or domain. Domain is not mandatory for Xamarin App to be connected. Xamarin can connect to your MVC with an IP Address as well. Test if your website is running via a browser. Let's say you have successfully added your website to the following URL

    http://123.123.123.123:8080/
    

    <ins>CONFIGURING ASPNET ZERO XAMARIN APP to CONNECT THE PUBLISHED MVC</ins> 1- Open the Xamarin app in Visual Studio. Go to the ApiUrlConfig.cs <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Application.Client/ApiClient/ApiUrlConfig.cs">https://github.com/aspnetzero/aspnet-ze ... lConfig.cs</a>

    private const string DefaultHostUrl =  "http://123.123.123.123:8080/"; //TODO: Replace with PROD url.
        /* --- or you can set a domain as well
               private const string DefaultHostUrl = "http://YourMvcWebsite.com/";
        */
    

    Now the Xamarin App can connect to this address for data transfer.

    2- Set project to Release mode.

    3- Android Manifest * Application name: Your Application Name * Package name: com.yourwebsite.mobile * Version number: 1 (always increase the current) * Version name: 3.1 (always increase the current)

    4- Android Options * Use Shared Runtime: Unchecked [ ] * Linking > Sdk Assemblies Only

    7- Right click the MyProject.Droid project and click Archieve.

    8- When finish, click Ad-Hoc button * Certificate password: ****

    9- When finish, click Open Folder * C:\Users&lt;your-username>\AppData\Local\Xamarin\Mono for Android\Archives&lt;yyyy-mm-dd>&lt;your-project-name>.Droid 5-21-18 11.09 AM.apkarchive\signed-apks

    I hope it'll be helpful! Happy coding ;)