UA Supports Ionic 2/3 framework platforms or not?

Is UA supports to IONIC 2/3 platform or not. please help me, how to define UA methods in app.componets.ts file in ionic 2/3. Is there any solution for this. how to handle UA methods in typescript files.

Didn't find what you were looking for?

New post

Comments

4 comments

  • Hi Ganesh,

    Urban Airship does not official support Ionic frameworks, however we have had customers successfully implement our Phonegap Plugin within their Ionic project before, so it is not outside the realm of possibilities.

    While we won't be able to provide specific instructions for Ionic, we can provide help for the Phonegap plugin since that should work alongside Ionic. 

    Comment actions Permalink
    1
  •  

    Is there any update along the lines of implementing UA in ionic 3? We're currently using OneSignal, and are considering a switch to UA.

     

     

    Comment actions Permalink
    0
  • Hi Christian,

    Many of our customers today who utilize Ionic are able to successfully integrate their apps with UA using our Cordova Plugin.

    Our Cordova Plugin is compatible with Ionic, and the same instructions to integrate our Cordova plugin will also apply for installing in to your Ionic project.

    Comment actions Permalink
    0
  • You basically need to create provider to use the methods in UrbanAirship.

    Below is the snippet

     

    create a Provider as urban-airship.ts

    ===============================

    import { Plugin, Cordova} from '@ionic-native/core'
    import {Injectable} from '@angular/core';


    @Plugin({
      pluginName: 'Urban Airship',
      plugin: 'urbanairship-cordova',
      pluginRef: 'UAirship',
      platforms: ['Android','iOS']
    })


    @Injectable()
    export class UrbanAirshipProvider {

      @Cordova()
      getChannelID(): Promise<any> { return; }
      
      @Cordova()
      getNamedUser(): Promise<any> { return; }

      @Cordova()
      setQuietTime(startHr,startMin,endHr,endMin): Promise<any> { return; }

      @Cordova()
      setQuietTimeEnabled(enabled): Promise<any> { return; }

      @Cordova()
      updateRegistration(): Promise<any> { return; }

      // [[UAirship push] setQuietTimeStartHour:19 startMinute:30 endHour:7 endMinute:30];
    }
     
     

     

    In app.module.ts

    ==============

    import { UrbanAirshipProvider } from '../providers/urban-airship/urban-airship';
     
    add it in provider
     
    In ts where you need to call below is the code
     
    import { UrbanAirshipProvider } from '../../providers/urban-airship/urban-airship';
     
    constructor(private UAirship:UrbanAirshipProvider)
     
    this.UAirship.getChannelID().then(result=>{
            console.log("result :::",result);
          }).catch(err=>{
            console.log("result :::",err);
          })

     

     

     

     

    Comment actions Permalink
    0

Please sign in to leave a comment.