
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
nativescript-urban-airship
Advanced tools
This is a plugin to use the Urban Airship SDK (Android v14.4.0, iOS v14.4.1) with NativeScript.
For iOS this plugin uses APNS and for Android it uses FCM.
Run the following command from the root of your project:
npm install nativescript-urban-airship
First create a file with all your Urban Airship setting (example).
Create a custom native android.app.Application in your app folder (example) that calls startUp()
with your settings in the onCreate()
:
public onCreate(): void {
super.onCreate();
NsUrbanAirship.getInstance().startUp(urbanAirshipSettings, this);
}
Use that custom application in the application tag in your AndroidManifest.xml
(example).
Place your google-services.json
in your App_Resources/Android
folder. This json file can be created using the setup of FCM.
Copy the hooks firebase-adjust-gradle.js and firebase-copy-google-services.js from our demo app to the after-prepare
folder of your app.
Specify the right applicationId
in your app's app.gradle
(example).
Specify the right id
in your app's package.json
.
Create a custom UIApplicationDelegate in your app folder (example) that calls startUp()
with your settings in the applicationDidFinishLaunchingWithOptions()
:
applicationDidFinishLaunchingWithOptions(application: UIApplication, launchOptions: NSDictionary<string, any>): boolean {
NsUrbanAirship.getInstance().startUp(urbanAirshipSettings, null);
return true;
};
Import that custom UIApplicationDelegate in your app.ts
(example).
When using webpack, calling startUp()
on Android in a custom native android.app.Application is not working, in that case it is better to call the native function instead of startUp()
:
public onCreate(): void {
super.onCreate();
const options = new com.urbanairship.AirshipConfigOptions.Builder()
.setDevelopmentAppKey(urbanAirshipSettings.developmentAppKey)
.setDevelopmentAppSecret(urbanAirshipSettings.developmentAppSecret)
.setProductionAppKey(urbanAirshipSettings.productionAppKey)
.setProductionAppSecret(urbanAirshipSettings.productionAppSecret)
.setInProduction(urbanAirshipSettings.inProduction)
.setFcmSenderId(urbanAirshipSettings.fcmSender)
.build();
com.urbanairship.UAirship.takeOff(this, options);
}
To register a named user id call registerUser()
.
NsUrbanairship.getInstance().registerUser('MY_NEW_USER_ID');
To remove a named user id call unRegisterUser()
.
NsUrbanairship.getInstance().unRegisterUser();
To set user notifications to enabled call notificationOptIn()
.
NsUrbanairship.getInstance().notificationOptIn();
To set user notifications to disabled call notificationOptOut()
.
NsUrbanairship.getInstance().notificationOptOut();
To get the status of enabled push notifications call isOptIn()
, this will return true or false.
NsUrbanairship.getInstance().isOptIn();
To get the channel ID call getChannelID()
, this will return a string.
NsUrbanairship.getInstance().getChannelID();
To get the registration token (APNS token for iOS and FCM token for Android) call getRegistrationToken()
, this will return a string.
NsUrbanairship.getInstance().getRegistrationToken();
To reset the badge count call resetBadgeCount()
.
NsUrbanairship.getInstance().resetBadgeCount();
FAQs
Urban Airship plugin for NativeScript.
We found that nativescript-urban-airship demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.