Expand my Community achievements bar.

SOLVED

Adobe Target Mobile App IOS Implementation

Avatar

Level 2

Hello Everyone,

I am trying to implement basic Adobe Target  and an AB Test on Mobile following the instructions listed in below Git URL  :

L3 : Create your first AB test · adobe-target/mobile-lab Wiki · GitHub

I am able to see Mbox successfully fired and it does show up in the target interface as well when I try to create an activity ..

But I always see default content which exists in the code level even though, I have selected the same mbox which I am firing from the Xcode during activity creation

Below are screenshots of code and activity which I have created and debug log which I am seeing in Xcode console ..

2019-10-16 17:12:06.300735+1100 AdobeMobile[50600:828140] ADBMobile Debug: Config - Loaded 5 root elements

2019-10-16 17:12:06.301333+1100 AdobeMobile[50600:828140] ADBMobile Debug: Messages - Attempting to load bundled In-App Messages.

2019-10-16 17:12:06.301549+1100 AdobeMobile[50600:828140] ADBMobile Debug: Messages - Attempting to load cached In-App Messages.

2019-10-16 17:12:06.301844+1100 AdobeMobile[50600:828140] ADBMobile Debug: Cached Files - No URL for cached file.

2019-10-16 17:12:06.301966+1100 AdobeMobile[50600:828140] ADBMobile Debug: Messages - No Messages to load.

2019-10-16 17:12:06.302098+1100 AdobeMobile[50600:828140] ADBMobile Debug: Config - Attempting to load cached POI data.

2019-10-16 17:12:06.302211+1100 AdobeMobile[50600:828140] ADBMobile Debug: Cached Files - No URL for cached file.

2019-10-16 17:12:06.302365+1100 AdobeMobile[50600:828140] ADBMobile Debug: Config - No remote POI's available

2019-10-16 17:12:06.307376+1100 AdobeMobile[50600:828140] ADBMobile Debug: Target - requesting content from url "https://mboxedge29.tt.omtrdc.net/rest/v1/mbox/1FBBD585-EE92-43CD-8553-90111E73BF60?client=<clientcode>" with parameters: {

    clientSideAnalyticsLogging = 1;

    marketingCloudVisitorId = 86649646485916493420660873365931701886;

    mbox = 123456ABTest;

    mboxParameters =     {

        "a.AppID" = "AdobeMobile 1.0 (1)";

        "a.CarrierName" = "(null)";

        "a.CrashEvent" = CrashEvent;

        "a.DayOfWeek" = 4;

        "a.DaysSinceFirstUse" = 0;

        "a.DaysSinceLastUse" = 0;

        "a.DeviceName" = "x86_64";

        "a.HourOfDay" = 16;

        "a.LaunchEvent" = LaunchEvent;

        "a.Launches" = 24;

        "a.OSVersion" = "iOS 13.0";

        "a.Resolution" = 750x1334;

        "a.locale" = "en-US";

        "a.ltv.amount" = 0;

        mboxAAMB = j8Odv6LonN4r3an7LhD3WZrU1bUpAkFkkiY1ncBR96t2PTI;

        mboxMCGLH = 8;

    };

}

2019-10-16 17:12:06.843480+1100 AdobeMobile[50600:828141] [] nw_proxy_resolver_create_parsed_array [C1 proxy pac] Evaluation error: NSURLErrorDomain: -1003

2019-10-16 17:12:07.117177+1100 AdobeMobile[50600:828139] ADBMobile Debug: Target - Content was empty

2019-10-16 17:12:07.117384+1100 AdobeMobile[50600:828144] ⚡️Response from Target ---  Swap it ! ⚡️

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

Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]

PID: 50600, TID: 828140, Thread name: (none), Queue name: com.adobe.analytics.processing, QoS: 0

Backtrace:

4   AdobeMobile                         0x000000010156c5f2 +[ADBApplicationOnlyFunctionality isRunningOnBackground] + 41

5   AdobeMobile                         0x0000000101556517 +[ADBAppOnlyFuncBridge isRunningOnBackground] + 105

6   AdobeMobile                         0x000000010155b2fd __ADBLifecycleStartInternal_block_invoke + 58

7   libdispatch.dylib                   0x00000001018d6df0 _dispatch_call_block_and_release + 12

8   libdispatch.dylib                   0x00000001018d7d64 _dispatch_client_callout + 8

9   libdispatch.dylib                   0x00000001018de60b _dispatch_lane_serial_drain + 788

10  libdispatch.dylib                   0x00000001018df19b _dispatch_lane_invoke + 422

11  libdispatch.dylib                   0x00000001018eaa59 _dispatch_workloop_worker_thread + 722

12  libsystem_pthread.dylib             0x00007fff5141c611 _pthread_wqthread + 421

13  libsystem_pthread.dylib             0x00007fff5141c3fd start_wqthread + 13

2019-10-16 17:12:07.127214+1100 AdobeMobile[50600:828140] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]

PID: 50600, TID: 828140, Thread name: (none), Queue name: com.adobe.analytics.processing, QoS: 0

Backtrace:

4   AdobeMobile                         0x000000010156c5f2 +[ADBApplicationOnlyFunctionality isRunningOnBackground] + 41

5   AdobeMobile                         0x0000000101556517 +[ADBAppOnlyFuncBridge isRunningOnBackground] + 105

6   AdobeMobile                         0x000000010155b2fd __ADBLifecycleStartInternal_block_invoke + 58

7   libdispatch.dylib                   0x00000001018d6df0 _dispatch_call_block_and_release + 12

8   libdispatch.dylib                   0x00000001018d7d64 _dispatch_client_callout + 8

9   libdispatch.dylib                   0x00000001018de60b _dispatch_lane_serial_drain + 788

10  libdispatch.dylib                   0x00000001018df19b _dispatch_lane_invoke + 422

11  libdispatch.dylib                   0x00000001018eaa59 _dispatch_workloop_worker_thread + 722

12  libsystem_pthread.dylib             0x00007fff5141c611 _pthread_wqthread + 421

13  libsystem_pthread.dylib             0x00007fff5141c3fd start_wqthread + 13

Can someone help me understand where am I going wrong?

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi Anudeep,

From your screenshot it appears that you have included a Property "Test Mobile App" to you AB Activity

When you assign a Property to the Activity you need to pass the at_property value as a TargetParam,  the default code in the sample app it is not passing any params. it is not using a Property.

You will need to open your Property and retrieve the Implementation Code is will look similar to this in your UI

"at_property": "037667cb-cfdd-82d7-64f1-a0b079fcc972"

Then in your app code you will need to modify your code to similar as below

//add these lines to pass targetParams this needs to include your at_property

NSDictionary *targetParams = [[NSDictionary alloc] initWithObjectsAndKeys:

    @"037667cb-cfdd-82d7-64f1-a0b079fcc972",@"at_property",

    nil];

  

//modify parameters from nil to targetParams

    ADBTargetLocationRequest* locationRequest = [ADBMobile targetCreateRequestWithName:@"a1-mobile-ab"

                                                                        defaultContent:@"Hello there!"

                                                                            parameters:targetParams];

   

    [ADBMobile targetLoadRequest:locationRequest callback:^(NSString *content){

        NSLog(@"⚡️Response from Target --- %@ ⚡️", content);

Once you make this change then you should receive either Experience A or B versus the default content.

Regards,

Jen

View solution in original post

6 Replies

Avatar

Level 10

Hi Anudeep,

It looks like your question may have been accidentally resolved before you received an answer. I apologize for that and I'll look into how that might have happened. In the meantime I've reopened your question and I'll see if we can get a few Target folks to provide some input here. Unfortunately, I'm not a Target expert myself but I do know a few. I'll tag them here and share this thread internally to make sure we get you taken care of.

mikewebguy1​ - Can you take a look here?

Thanks,
Jantzen

Experience Cloud Community Manager

Avatar

Correct answer by
Employee

Hi Anudeep,

From your screenshot it appears that you have included a Property "Test Mobile App" to you AB Activity

When you assign a Property to the Activity you need to pass the at_property value as a TargetParam,  the default code in the sample app it is not passing any params. it is not using a Property.

You will need to open your Property and retrieve the Implementation Code is will look similar to this in your UI

"at_property": "037667cb-cfdd-82d7-64f1-a0b079fcc972"

Then in your app code you will need to modify your code to similar as below

//add these lines to pass targetParams this needs to include your at_property

NSDictionary *targetParams = [[NSDictionary alloc] initWithObjectsAndKeys:

    @"037667cb-cfdd-82d7-64f1-a0b079fcc972",@"at_property",

    nil];

  

//modify parameters from nil to targetParams

    ADBTargetLocationRequest* locationRequest = [ADBMobile targetCreateRequestWithName:@"a1-mobile-ab"

                                                                        defaultContent:@"Hello there!"

                                                                            parameters:targetParams];

   

    [ADBMobile targetLoadRequest:locationRequest callback:^(NSString *content){

        NSLog(@"⚡️Response from Target --- %@ ⚡️", content);

Once you make this change then you should receive either Experience A or B versus the default content.

Regards,

Jen

Avatar

Employee

Thanks for the pointers @JenAndrews.

Avatar

Level 2

Hi Jen ,

Figured that out after posting this question

Thanks for the reply , We can close this ..

Anu

Avatar

Level 2

Hi Jantzen,

Thanks, Really appreciate it.

I do still have an open question that has not been answered/confirmed by Adobe Staff, After waiting for a few days and observed no one cared to answer, I closed it my self.

I would highly appreciate if you can get the right person on this as well:  https://forums.adobe.com/thread/2653458

Thanks

Anu