1

I have a simple web app that let's user register and login using firebase as my backend (let's say www.my-app.com). I am thinking to deploy it to IOS and Android to to achieve additional feature such as push notification.

I think it would be great if the following would work but I am not sure if it is possible

  1. Create an ionic app that consists of mainly just one big web view that covers the whole screen.

  2. When the user opens up the app, he sees the login screen from www.my-app.com and enters his details.

  3. At this point, I'd like my ionic app to capture whatever the user does to the web page. For example, upon successfully logged in, the ionic app should be able to grab the login details from the user input (email) and go and register for push notification using that email.

So in other words, is it possible to communicate in and out of the web view such that I can achieve tasks like

  1. Use Ionic's framework to programatically input a text field inside the web view to 'Hello World' when the page is loaded.
  2. When user logs in to www.my-app.com, firebase returns some data to the webpage(First Name Last Name for example). Then do some logic that is outside the web view such as show a ionic popup with 'Hi John Doe'

I understand there are draw back for doing a web-view as an app. However, it would be really cool if this is achievable as this will significantly reduce production time for straight forward form-based web page.

8
  • All of this is possible with ionic/cordova. Commented Mar 14, 2017 at 5:27
  • you can use ionicframework.com which will allow ou to create android and ios app using angular 2. also you can look at the native script nativescript.org. and also cordova.apache.org. that is all you need to know to create android and ios app using web technology like, js, html, and css. Commented Mar 14, 2017 at 5:32
  • using ionic would be easy you can create your sample app using few steps which you can find here ionicframework.com/getting-started Commented Mar 14, 2017 at 5:33
  • My understanding with ionic framework is that I have to sort of create the app from scratch using web technology as oppose to using a web view that utilises my pre-existing web app (www.sampleApp.com)? For example a login screen, I will have to create ionic input fields and buttons as oppose to use my current login screen from www.sampleApp.com/login? Commented Mar 14, 2017 at 5:37
  • in past, i have created one app which receives push notification in ionic app, but that was an angular ionic app, i haven't tried ionic 2. but what are you thinking it is possible using ionic2 or ionic. Commented Mar 14, 2017 at 5:38

1 Answer 1

2
+50

Yes it is possible using ionic 2 native inappbrowser plugin here:

let browser = new InAppBrowser('https://ionic.io', '_system');
browser.executeScript(...);
browser.insertCSS(...);
browser.close();

But you will definitely have issues when trying to deploy to iOS store. iOS has strict Guidelines

Why not build an ionic 2 app with firebase ?, Its supported here .

import { Firebase } from 'ionic-native';

Firebase.getToken()
  .then(token => console.log(`The token is ${token}`)) // save the token server-side and use it to push notifications to this device
  .catch(error => console.error('Error getting token', error));

Firebase.onTokenRefresh()
  .subscribe((token: string) => console.log(`Got a new token ${token}`));

Doing it with code is way easier and you will not have issues when deploying it to android and iOS

You can also build in push notifications with ionic cloud services with just a few lines of code

const cloudSettings: CloudSettings = {
  'core': {
    'app_id': 'APP_ID'
  }
};
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.