Edit in GitHubLog an issue

Java

Add the Mobile Core extension to your project using the app's Gradle file.

Copied to your clipboard
implementation 'com.adobe.marketing.mobile:sdk-core:1.+'

Import the Signal extension in your application's main activity.

Copied to your clipboard
import com.adobe.marketing.mobile.*;

​The Signal extension is included in the Mobile Core extension. Add the Mobile Core extension to your project using Cocoapods.

Add following pods in your Podfile:

Copied to your clipboard
pod 'ACPCore', '~> 2.0'

Import the Signal libraries:

Objective-C

Copied to your clipboard
#import "ACPCore.h"
#import "ACPSignal.h"

Swift

In Swift, the ACPCore includes ACPSignal:

Copied to your clipboard
import ACPCore

JavaScript

Importing the Signal extension:

Copied to your clipboard
import {ACPSignal} from '@adobe/react-native-acpcore';

Dart

Importing the Signal extension:

Copied to your clipboard
import 'package:flutter_acpcore/flutter_acpsignal.dart';

Cordova

After creating your Cordova app and adding the Android and iOS platforms, the Signal extension for Cordova can be added with this command:

Copied to your clipboard
cordova plugin add https://github.com/adobe/cordova-acpcore.git

C#

After importing the ACPCore.unitypackage, the Signal extension for Unity can be added with following code in the MainScript

Copied to your clipboard
using com.adobe.marketing.mobile;

C#

After adding the iOS ACPCore NuGet package or the Android ACPSignal NuGet package, the Signal extension can be added by this import statement

Copied to your clipboard
using Com.Adobe.Marketing.Mobile;

Java

After calling the setApplication() method in the onCreate() method, register the Signal extension. If the registration was not successful, an InvalidInitException is thrown.

Copied to your clipboard
public class MobileApp extends Application {
@Override
public void onCreate() {
super.onCreate();
MobileCore.setApplication(this);
try {
Signal.registerExtension();
// register other extensions
MobileCore.start(new AdobeCallback () {
@Override
public void call(Object o) {
MobileCore.configureWithAppID("yourAppId");
}
});
} catch (Exception e) {
//Log the exception
}
}
}

Please note that the Signal extension is automatically included in the Mobile Core extension by Maven. When you manually install the Signal extension, ensure that you add the signal-1.x.x.aar library to your project.

In your app'sapplication:didFinishLaunchingWithOptions, register the Signal extension with Mobile Core:

Objective-C

Copied to your clipboard
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[ACPCore configureWithAppId:@"yourAppId"];
[ACPSignal registerExtension];
[ACPCore start:nil];
// Override point for customization after application launch.
return YES;
}

Swift

Copied to your clipboard
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
ACPCore.configure(withAppId: "yourAppId")
ACPSignal.registerExtension()
ACPCore.start(nil)
// Override point for customization after application launch.
return true;
}

Please note that the Signal extension is automatically included in the Mobile Core pod. When you manually install the Signal extension, ensure that you add the libACPSignal_iOS.a library to your project.

JavaScript

When using React Native, registering Signal with Mobile Core should be done in native code which is shown under the Android and iOS tabs.

Dart

When using Flutter, registering Signal with Mobile Core should be done in native code which is shown under the Android and iOS tabs.

Cordova

When using Cordova, registering Signal with Mobile Core must be done in native code which is shown under the Android and iOS tabs.

C#

Register the extension in the start() function:

Copied to your clipboard
void Start()
{
ACPSignal.RegisterExtension();
}

C#

iOS

Register the Signal extension with the Mobile Core by adding the following to your app's FinishedLaunching: delegate method:

Copied to your clipboard
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
ACPSignal.RegisterExtension();
// start Mobile Core
ACPCore.Start(startCallback);
return base.FinishedLaunching(app, options);
}
private void startCallback()
{
// set app id from the Data Collection UI
ACPCore.ConfigureWithAppID("yourAppId");
}

Android

Register the Signal extension with the Mobile Core by adding the following to your app's OnCreate: method:

Copied to your clipboard
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
LoadApplication(new App());
ACPCore.Application = this.Application;
ACPSignal.RegisterExtension();
// start Mobile Core
ACPCore.Start(new CoreStartCompletionCallback());
}
class CoreStartCompletionCallback : Java.Lang.Object, IAdobeCallback
{
public void Call(Java.Lang.Object callback)
{
// set app id from the Data Collection UI
ACPCore.ConfigureWithAppID("yourAppId");
}
}
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.