Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
nativescript-adobe-marketing-cloud
Advanced tools
Nativescript Adobe marketing cloud integration plugin
npm install nativescript-adobe-marketing-cloud --save
Based on:
Listen to lifecycle events:
import * as application from "application";
import {AdobeAnalytics} from "nativescript-adobe-marketing-cloud";
application.on(application.launchEvent, function (args: application.ApplicationEventData) {
if (args.android) {
AdobeAnalytics.getInstance().setContext(application.android.context);
} else if (args.ios !== undefined) {
AdobeAnalytics.getInstance().collectLifecycleData(null);
}
});
application.on(application.suspendEvent, function (args: application.ApplicationEventData) {
if (args.android) {
AdobeAnalytics.getInstance().pauseCollectingLifecycleData();
}
});
application.on(application.resumeEvent, function (args: application.ApplicationEventData) {
if (args.android) {
AdobeAnalytics.getInstance().collectLifecycleData(application.android.foregroundActivity);
}
});
if (application.android) {
application.android.on(application.AndroidApplication.activityPausedEvent, function (args: application.AndroidActivityEventData) {
AdobeAnalytics.getInstance().pauseCollectingLifecycleData();
});
application.android.on(application.AndroidApplication.activityResumedEvent, function (args: application.AndroidActivityEventData) {
AdobeAnalytics.getInstance().collectLifecycleData(application.android.foregroundActivity);
});
}
application.start({ moduleName: "main-page" });
Get the config file from the Adobe dashboard.
place ADBMobileConfig.json
file in app\App_Resources\iOS
place adbmobileconfig.json
file in app\App_Resources\Android\raw
States and actions can be traced through method calls that match their native counterparts signature.
See: https://marketing.adobe.com/resources/help/en_US/mobile/ios/privacy.html
Select a privacy option:
Send Data Until Opt-Out
AdobeAnalytics.getInstance().optIn();
Hold Data Until Opt-In
AdobeAnalytics.getInstance().optOut();
See: https://marketing.adobe.com/resources/help/en_US/mobile/ios/hybrid_app.html You can call:
AdobeAnalytics.getInstance().visitorAppendToURL(url);
This will return the url provided extended with the visitorId.
For easier development and debugging purposes continue with the following steps:
src
folder and run npm run demo.ios
or npm run demo.android
to run the demo.src
folder and run npm run plugin.tscwatch
to watch for file changes in your plugin.Now go and make a change to your plugin. It will be automatically applied to the demo project.
NOTE: If you need to use a native library in your plugin or do some changes in Info.plist/AndroidManifest.xml, these cannot be applied to the demo project only by npm link. In such scenario, you need to use tns plugin add ../src
from the demo
so that the native libraries and changes in the above-mentioned files are applied in the demo. Then you can link again the code of your plugin in the demo by using npm run plugin.link
from the src
.
You will want to create these folders and files in the src
folder in order to use native APIs:
platforms --
ios --
Podfile
android --
include.gradle
Doing so will open up those native apis to your plugin :)
Take a look at these existing plugins for how that can be done very simply:
Sometimes you may need to wipe away the node_modules
and demo/platforms
folders to reinstall them fresh.
npm run clean
to wipe those clean then you can can run npm i
to install fresh dependencies.Sometimes you just need to wipe out the demo's platforms
directory only:
npm run demo.reset
to delete the demo's platforms
directory only.Sometimes you may need to ensure plugin files are updated in the demo:
npm run plugin.prepare
will do a fresh build of the plugin then remove itself from the demo and add it back for assurance.The plugin seed automatically adds Jasmine-based unittest support to your plugin.
Open demo/app/tests/tests.js
and adjust its contents so the tests become meaningful in the context of your plugin and its features.
You can read more about this topic here.
Once you're ready to test your plugin's API go to src
folder and execute one of these commands:
npm run test.ios
npm run test.android
When you have everything ready to publish:
src/package.json
publish
and execute publish.sh
(run chmod +x *.sh
if the file isn't executable)If you just want to create a package, go to publish
folder and execute pack.sh
. The package will be created in publish/package
folder.
NOTE: To run bash script on Windows you can install GIT SCM and use Git Bash.
The plugin structure comes with a fully functional .travis.yml file that deploys the testing app on Android emulator and iOS simulator and as a subsequent step runs the tests from UnitTesting section. All you have to do, after cloning the repo and implementing your plugin and tests, is to sign up at https://travis-ci.org/. Then enable your plugin's repo on "https://travis-ci.org/profile/<your github user>" and that's it. Next time a PR is opened or change is committed to a branch TravisCI will trigger a build testing the code.
To properly show current build status you will have to edit the badge at the start of the README.md file so it matches your repo, user and branch.
We recommend to use full imports of tns-core-modules
due to an issue in Angular CLI. Read more detailed explanation in this discussion.
Ultimately after the issue in Angular CLI is fixed this would not be a restriction, but till then the recommended approach is to import from tns-core-modules
using full path. Here is an example:
WRONG
tsconfig.json
...
"paths": {
"*": [
"./node_modules/*",
"./node_modules/tns-core-modules/*"
]
}
...
yourplugin.common.ts
import * as app from 'application';
RIGHT
yourplugin.common.ts
import * as app from 'tns-core-modules/application';
FAQs
Nativescript Adobe marketing cloud integration plugin
The npm package nativescript-adobe-marketing-cloud receives a total of 0 weekly downloads. As such, nativescript-adobe-marketing-cloud popularity was classified as not popular.
We found that nativescript-adobe-marketing-cloud demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.