Giter Club home page Giter Club logo

appboy-segment-ios's Introduction

Braze Logo

Braze iOS Segment SDK

Version Carthage compatible License

Braze integration for analytics-ios.

Installation

Analytics is available through CocoaPods and Carthage.

Cocoapods

To install the Braze integration through Cocoapods, simply add the following line to your Podfile:

pod "Segment-Appboy"

If you would like to use the Appboy-iOS-SDK/Core subspec instead of the full Appboy-iOS-SDK pod, edit your Podfile entry to:

pod "Segment-Appboy/Core"

Carthage

To install the Braze integration through Carthage, add the following lines to your Cartfile:

github "segmentio/analytics-ios"
github "appboy/appboy-segment-ios"
github "appboy/appboy-ios-sdk"

And run:

carthage update

Follow the standard procedure to add the frameworks built/retrieved by Carthage to your project (see Adding frameworks to an application)

Swift Package Manager

To install the Braze integration through Swift Package Manager, follow these steps:

  • Select File > Swift Packages > Add Package Dependency.
  • In the search bar, enter https://github.com/Appboy/appboy-segment-ios. Select either AppboySegment or AppboySegmentCore, depending on your use case.
  • In your app's target, under Build Settings > Other Linker Flags, add the -ObjC linker flag.
  • In the Xcode menu, click Product > Scheme > Edit Scheme...
  • Click the expand ▶️ next to Build and select Post-actions. Press + and select New Run Script Action.
  • In the dropdown next to Provide build settings from, select your app's target.
  • Copy this script into the open field:
bash "$BUILT_PRODUCTS_DIR/Appboy_iOS_SDK_AppboyKit.bundle/Appboy.bundle/appboy-spm-cleanup.sh"

Usage

After adding the dependency, you must register the integration with our SDK. To do this, import the Braze integration in your AppDelegate:

#import "SEGAppboyIntegrationFactory.h"

Note: When using Swift Package Manager, you will need to import the SDK using import AppboySegment or import AppboySegmentCore depending on which package you are using.

And add the following lines:

Objective-C

NSString *const SEGMENT_WRITE_KEY = @" ... ";
SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:SEGMENT_WRITE_KEY];

[config use:[SEGAppboyIntegrationFactory instance]];

[SEGAnalytics setupWithConfiguration:config];

Swift

let SEGMENT_WRITE_KEY = " ... "
let config = SEGAnalyticsConfiguration(writeKey: SEGMENT_WRITE_KEY)

config.use(SEGAppboyIntegrationFactory.instance())

SEGAnalytics.setup(with: config)

Please see our documentation for more information.

Endpoint Customization

  • You must set your endpoint via the ABKEndpointKey inside the appboyOptions parameter passed to startWithApiKey:inApplication:withLaunchOptions:withAppboyOptions:.
  • Set the value to your custom endpoint URL’s authority (for example, sdk.iad-01.braze.com, not https://sdk.iad-01.braze.com).

License

WWWWWW||WWWWWW
 W W W||W W W
      ||
    ( OO )__________
     /  |           \
    /o o|    MIT     \
    \___/||_||__||_|| *
         || ||  || ||
        _||_|| _||_||
       (__|__|(__|__|

The MIT License (MIT)

Copyright (c) 2014 Segment, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

appboy-segment-ios's People

Contributors

bucimis avatar chshapiro avatar jerielng avatar teresanesteby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appboy-segment-ios's Issues

How to configure in a project with a Swift AppDelegate?

I want to configure this for use in a new project using Swift, but the usage instructions only include Objective C instructions.

I'm able to load Segment, but I'm not sure how to go about telling the configuration to integrate with Braze:

        import Segment
        let segmentConfig = AnalyticsConfiguration(writeKey:"SOME-API-KEY")
        Analytics.setup(with: segmentConfig)

I can't find a reference to SEGAppboyIntegrationFactory or any way to import it. I looked into creating bridging headers, but from what I've read it seems like this needs to be done by the package maintainers themselves.

Thank you!

warning AppBoy shared instance

Hi,

We are experiencing a weird warning :

********************************************
     **             !! WARNING !!              **
     **     [Appboy sharedInstance] called     **
     **     before Appboy was initialized,     **
     **       returning nil. Please make       **
     ** sure you call [Appboy startWithApiKey] **
     **  before accessing the sharedInstance.  **
********************************************

but AppBoy is initialized before :

// Init Segment
    SEGAnalyticsConfiguration *configuration = [SEGAnalyticsConfiguration configurationWithWriteKey:@"**********"];
    configuration.shouldUseLocationServices = NO;
    [configuration use:[SEGAppboyIntegrationFactory instance]];
    [SEGAnalytics setupWithConfiguration:configuration];
    [SEGAnalytics debug:NO];
    
[[Appboy sharedInstance] registerPushToken:****];

SDK : Segment-Appboy
SDK Version :

 - Segment-Appboy (1.0.4):
    - Analytics (~> 3.0)
    - Appboy-iOS-SDK (= 2.28.0)

iOS : 10

Integration performs UI call on background thread

When running our app on Xcode 9 beta 1, which includes a UI call checker on background threads in debug mode, we notice the following error:

=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]
PID: 71346, TID: 3467076, Thread name: (none), Queue name: io.segment.analytics, QoS: 0
Backtrace:
4   Segment_Appboy                      0x0000000108f3f4eb -[SEGAppboyIntegration applicationDidFinishLaunching:] + 91
5   CoreFoundation                      0x000000010ce54c3c __invoking___ + 140
6   CoreFoundation                      0x000000010ce54b10 -[NSInvocation invoke] + 320
7   CoreFoundation                      0x000000010ce6d356 -[NSInvocation invokeWithTarget:] + 54
8   Analytics                           0x000000010612b017 -[SEGIntegrationsManager invokeIntegration:key:selector:arguments:options:] + 1015
9   Analytics                           0x000000010612aaef __60-[SEGIntegrationsManager forwardSelector:arguments:options:]_block_invoke + 143
10  CoreFoundation                      0x000000010ce55632 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 210
11  Analytics                           0x000000010612a9a4 -[SEGIntegrationsManager forwardSelector:arguments:options:] + 356
12  Analytics                           0x000000010612bb91 __78-[SEGIntegrationsManager callIntegrationsWithSelector:arguments:options:sync:]_block_invoke + 129
13  Analytics                           0x00000001061212b1 __seg_dispatch_specific_block_invoke + 49
14  libdispatch.dylib                   0x000000010ea4d1d9 _dispatch_call_block_and_release + 12
15  libdispatch.dylib                   0x000000010ea4e1c1 _dispatch_client_callout + 8
16  libdispatch.dylib                   0x000000010ea55e4a _dispatch_queue_serial_drain + 700
17  libdispatch.dylib                   0x000000010ea56715 _dispatch_queue_invoke + 332
18  libdispatch.dylib                   0x000000010ea58d01 _dispatch_root_queue_drain + 579
19  libdispatch.dylib                   0x000000010ea58a57 _dispatch_worker_thread4 + 47
20  libsystem_pthread.dylib             0x000000010ee99315 _pt[info] <= GET https://dev1.takescoop.com/system/info [200]
hread_wqthread + 1370
21  libsystem_pthread.dylib             0x000000010ee98da9 start_wqthread + 13
2017-06-14 21:05:57.653802-0700 Scoop Internal[71346:3467118] TIC Read Status [11:0x0]: 1:57
2017-06-14 21:05:57.635840-0700 Scoop Internal[71346:3467190] Could not successfully update network info during initialization.
2017-06-14 21:05:57.669208-0700 Scoop Internal[71346:3467118] TIC Read Status [11:0x0]: 1:57
2017-06-14 21:05:57.669244-0700 Scoop Internal[71346:3467076] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]
PID: 71346, TID: 3467076, Thread name: (none), Queue name: io.segment.analytics, QoS: 0
Backtrace:
4   Segment_Appboy                      0x0000000108f3f4eb -[SEGAppboyIntegration applicationDidFinishLaunching:] + 91
5   CoreFoundation                      0x000000010ce54c3c __invoking___ + 140
6   CoreFoundation                      0x000000010ce54b10 -[NSInvocation invoke] + 320
7   CoreFoundation                      0x000000010ce6d356 -[NSInvocation invokeWithTarget:] + 54
8   Analytics                           0x000000010612b017 -[SEGIntegrationsManager invokeIntegration:key:selector:arguments:options:] + 1015
9   Analytics                           0x000000010612aaef __60-[SEGIntegrationsManager forwardSelector:arguments:options:]_block_invoke + 143
10  CoreFoundation                      0x000000010ce55632 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 210
11  Analytics                           0x000000010612a9a4 -[SEGIntegrationsManager forwardSelector:arguments:options:] + 356
12  Analytics                           0x000000010612bb91 __78-[SEGIntegrationsManager callIntegrationsWithSelector:arguments:options:sync:]_block_invoke + 129
13  Analytics                           0x00000001061212b1 __seg_dispatch_specific_block_invoke + 49
14  libdispatch.dylib                   0x000000010ea4d1d9 _dispatch_call_block_and_release + 12
15  libdispatch.dylib                   0x000000010ea4e1c1 _dispatch_client_callout + 8
16  libdispatch.dylib                   0x000000010ea55e4a _dispatch_queue_serial_drain + 700
17  libdispatch.dylib                   0x000000010ea56715 _dispatch_queue_invoke + 332
18  libdispatch.dylib                   0x000000010ea58d01 _dispatch_root_queue_drain + 579
19  libdispatch.dylib                   0x000000010ea58a57 _dispatch_worker_thread4 + 47
20  libsystem_pthread.dylib             0x000000010ee99315 _pthread_wqthread + 1370
21  libsystem_pthread.dylib             0x000000010ee98da9 start_wqthread + 13

Which links to this line: https://github.com/Appboy/appboy-segment-ios/blob/master/Pod/Classes/SEGAppboyIntegration.m#L219

Side-by-side integration without REST API

Hello guys
I’m trying to integrate Segment and Braze side-by-side. Documentation says that I don’t need to add Rest API key, but while trying to debug my code I noticed that this is not the case. Can you help me?

from docs:

Important:
For the side-by-side integration, inputting the “Braze REST API Key” into your Braze’s Connection Settings in the Segment Dashboard

Custom Events with "revenue" params not being sent

Hi, I've noticed that when we try to send a custom event through Segment SDK that has a param named "revenue", the event is not sent to Braze.

Analyzing the code, I could verify that on the line 214 in the file SEGAppboyIntegration.m exists a logic that prevent the sending of custom events in this case.

This is a problem because we need this param to other tools that we are sending events through Segment via the same method that send events to Braze.

I'm using the version 4.5.0 of the SDK, and we could confirm that this also happens in the Android sdk.

How can I ensure that custom events with "revenue" params are sent as intended?

Will there be Xamarin support?

Hello ,

We are integrating Braze through Segment in our Xamarin Forms project.
Will you provide Xamarin bindings for this repository?

If not you could you please provide instructions how can we achieve the same behavior ? Please update documentation for this feature through Xamarin as well.

Notify when AppBoy SDK is setup.

There doesn't appear to be a documented method, using the side-by-side integration, to know when the AppBoy sharedInstance has been configured and is ready to use. The Android version has an onSdkReady callback that can be hooked into for this purpose. It's quite important to do this so we can set some user properties immediately.

How would you advise doing this?

Issue opening Universal Links when app is inactive

Hi,

Context

We have found an issue with opening universal links received in remote notifications while the app is inactive (it works properly though while the app is in background or foreground). It's worth mentioning that we are using the UNUserNotificationCenter approach instead of the old didReceiveRemoteNotification way.

Our implementation

Following Braze documentation we register to the notificationCenter early in AppDelegate's didFinishLaunching:options method as follows:

UNUserNotificationCenter.current().delegate = self

Then we implement userNotificationCenter delegate didReceive method to forward the notification the notification to the integration factory and handle it properly:

open func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
   if Appboy.sharedInstance() == nil {
        brazeIntegrationFactory?.appboyHelper.save(center, notificationResponse: response)
   } else {
        brazeIntegrationFactory?.appboyHelper.userNotificationCenter(center, receivedNotificationResponse: response)
   }
}

We also use the integration initialization to setup ABKURLDelegate and to implement handleAppboyURL method:

func handleAppboyURL(_ url: URL?, from channel: ABKChannel, withExtras extras: [AnyHashable: Any]?) -> Bool {
     ...
     return true
}

While debugging we have found that everything is called when we receive a notification from Braze until SEGAppboyIntegration calls the Appboy internal method handleRemotePushNotification:withIdentifier:completionHandler:applicationState method, which we don't have access to. After that method is called from logPushIfComesInBeforeAppboyInitializedWithIdentifier we lose the track and handleAppboyURL is never called.

Again, if the notification is received while we are in background or foreground; OR if we refactor the project to use the old didReceiveRemoteNotification method instead of using UserNotificationCenter, everything works as expected so we are guessing that maybe there's some kind of internal condition inside the handleRemotePushNotification:withIdentifier:completionHandler:applicationState that is failing somehow.

Could you give us some kind of visibility of this issue and/or check that the implementation with userNotificationCenter is still working as expected?

pod install adds an older version

I'm trying to install Segment-Appboy with the latest 2.1.0 version.
Podfile -

pod 'Segment-Appboy'

When I run pod install, I see older versions of the SDKs being installed -

Installing Appboy-iOS-SDK (3.16.0)
Installing Segment-Appboy (2.0.3)

Invalid Property Value class __NSArrayM

Hi,

When I want to send a NSArray on an event, this NSArray is converted to a NSMutableArray by SEGCoerceJSONObject (from SEGAnalyticsUtils.m).
Yet, Appboy does not handle NSMutableArray but NSArray. So the Xcode debugger prints the following information :

[APPBOY] Invalid Property Value class __NSArrayM for key allergies removing.

Can you fix it ?

Thanks in advance,
Bilal

Get notified when Appboy.sharedInstance is initted

I couldn't figure out a way to get notified when segment triggers integration.initWithSettings (which creates the Appboy singleton).

My use case is that I want to enable NUI theming app-wide, whether I open the newsfeed explicitly or when getting an inapp notification. Usually you would put the following code in applicationDidFinishLaunching:

NUISettings.initWithStylesheet("AppBoy")
Appboy.sharedInstance()?.useNUITheming = true

but the shared instance will most likely be nil at this point because Segment asynchronously creates it (it has to fetch the API key first).

Is there a way to get notified of the singleton creation at the moment?

Push Notifications are not getting registered in Appboy SDK

These couple lines of code need to be refactored as these are deprecated.

[[Appboy sharedInstance] registerApplication:[UIApplication sharedApplication] didReceiveRemoteNotification:userInfo];

[[Appboy sharedInstance] getActionWithIdentifier:identifier forRemoteNotification:userInfo completionHandler:nil];

This is causing test content cards to not show up in the feed and potential flaky behavior on push notifications tracking as Direct Opens.

Missing cards on NewsFeed screen

Hi,

I'm using Braze through Segment to integrate on an iOS app and recently I'm facing an issue that on NewsFeed some of the cards just disappear for some users.

On my investigation around this, I've set up the example project with my Segment write key and identify with my user id so I can have a clean environment to test it properly.

The first attempt, with the project on its defaults, I was able to see all my cards on the NewsFeed, but I notice that when I've installed the dependencies the Appboy-iOS-SDK version was 3.11.0, not the last one as in my own project.

With this in mind, I've compared the example PodFile with mine and I've added the platform :ios, '9.3' line and also changed the project iOS Deployment Target to 9.3. After that, the Appboy-iOS-SDK has jumped to 3.15.0, and I can see the same issue of the missing cards on the NewsFeed screen. Also, on this version, I can see some logs that say invalid_api_key which might indicate that something is broken on the segment integration.

No matching actions for trigger event push_click

Hey Braze Team,

I'm receiving in app notification messages to my test device, but whenever I open the message the in app modal I've setup via Braze isn't displaying at all. So far I've done the following:

  • Create a draft campaign and ensured it was setup properly
  • Verified the in app message was actually delivered to the device via Braze developer console
  • Updated Braze SDK (4.3.2)
  • Updated SDImage library (5.11.1)
  • Enabled verbose mode locally via Info,plist file

NOTE: we're using Swift Package Manager to handle third party integrations.

Logs from Braze:
2021-08-30 10:58:39.835434-0400 MyLife[1780:485436] [APPBOY][DEBUG] -[ABKTriggerManager handleTriggerFromNotification:]_block_invoke Trigger sync in progress, adding trigger event to pending list. 2021-08-30 10:58:39.835483-0400 MyLife[1780:485436] [APPBOY][DEBUG] -[ABKTriggerManager handleTriggerFromNotification:]_block_invoke Trigger sync in progress, adding trigger event to pending list. 2021-08-30 10:58:39.835671-0400 MyLife[1780:483936] [APPBOY][DEBUG] -[ABKService request:finishedSuccessfully:] ABKDataServerRequest finished, completed successfully: 1 2021-08-30 10:58:39.835705-0400 MyLife[1780:483936] [APPBOY][DEBUG] -[ABKService dataRequest:finishedSuccessfully:] ABKDataServerRequest asked for feed: 0, triggers: 1, config: 0 2021-08-30 10:58:39.835751-0400 MyLife[1780:485437] [APPBOY][DEBUG] -[ABKTriggeredAction respondsToTriggerEvent:] Triggered action with id 612cf21ccd27882d47d2c924 matches trigger event with type test 2021-08-30 10:58:39.835789-0400 MyLife[1780:485437] [APPBOY][DEBUG] -[ABKTriggerManager processTriggerEvent:] No matching actions for trigger event test 2021-08-30 10:58:39.835822-0400 MyLife[1780:485437] [APPBOY][DEBUG] -[ABKTriggerManager processTriggerEvent:] No matching actions for trigger event push_click

I also followed this website here on troubleshooting Braze in app messages: https://www.braze.com/docs/developer_guide/platform_integration_guides/ios/in-app_messaging/troubleshooting/

So far it's not a delivery issue, but instead an issue with the in app modal message being displayed within the app. Looking forward to getting some help here and thanks!

Bitcode issues with version 2.0.1

Archiving an app that integrates Appboy through Segment as a pod, returns the following errors:

ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '900.0.37.0_0' Reader: '802.0.42_0')', using libLTO version 'LLVM version 8.1.0, (clang-802.0.42)' for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is the only output from the logs.

Feature Request: SEGAppboyIntegrationFactory doesn't seem to reflect the new iOS 10 notifications.

it would be nice if we could install a callback that gets triggered when segment finally initializes the AppBoy Instance with the Factory class. Because assume the following scenario

  1. app is not running
  2. app gets opened by AbbBoy Notifications Deeplink the user clicked on.
  3. App is getting started but Segment is not yet initialized at that moment (and also not AppBoy) when the NotificationCenter.delegate call back is called.

so I would like to do something like this:

    func userNotificationCenter(_ center: UNUserNotificationCenter,
                                         didReceive response: UNNotificationResponse,
                                         withCompletionHandler completionHandler: @escaping () -> Void) -> Bool  {
        let userInfo = response.notification.request.content.userInfo
        
        guard  ABKPushUtils.isAppboyRemoteNotification(userInfo) else { return false }

        let executeNotification = {
            // Let the appboy->segment integration know the user interacted with the push notification.
            SegmentFacade.shared.segment?.handleAction(withIdentifier: response.actionIdentifier, forRemoteNotification: userInfo)
            
            // This will actual trigger the deeplink in case, so it will call our AppDelegeate openUrl call back, with the URL that's 
            // in the JSON data/payload.
            Appboy.sharedInstance()?.userNotificationCenter(center, didReceive: response, withCompletionHandler: completionHandler)
        }

        // is appboy already setup?
        guard Appboy.sharedInstance() != nil else { self.delayedExecuteNotification = executeNotification; return true }
        
        executeNotification()

        return true
    }

And I setup Segment and AppBoy factory code up like this:

let config : SEGAnalyticsConfiguration
....     
guard let factory = SEGAppboyIntegrationFactory.instance() else { fatalError("Couldn't intialize SEGAppboyIntegrationFactory") }

// THIS IS THE FEATURE REQUEST CODE 
factory.notifiyAppBoyInitialized = { [weak self] in 

        guard let delayedExecuteNotification = self?.delayedExecuteNotification else { return }

        self?.delayedExecuteNotification = nil
        
        // when it gets initialized.
        DispatchQueue.main.async {
            delayedExecuteNotification()
        }
config.use(factory)

}

Typed up above code without compiling this.... sorry for any typos:

Missing "Ad" property for campaign install attribution

Recently, we have noticed that the integration does not actually propagate the "Ad" field through from Segment.

The code from

ABKAttributionData *attributionData = [[ABKAttributionData alloc]
is missing it. For reference it looks as follows:

- (void)track:(SEGTrackPayload *)payload
{
  if ([payload.event isEqualToString:@"Install Attributed"]) {
    if ([payload.properties[@"campaign"] isKindOfClass:[NSDictionary class]]) {
      NSDictionary *attributionDataDictionary = (NSDictionary *)payload.properties[@"campaign"];
      ABKAttributionData *attributionData = [[ABKAttributionData alloc]
                                             initWithNetwork:attributionDataDictionary[@"source"]
                                                    campaign:attributionDataDictionary[@"name"]
                                                     adGroup:attributionDataDictionary[@"ad_group"]
                                                    creative:attributionDataDictionary[@"ad_creative"]];
      [[Appboy sharedInstance].user setAttributionData:attributionData];
      return;
    }
  }

Notice how only ad group, name, source and creative are there. This leads to broken campaign data as you can see below

Screenshot 2019-07-30 at 12 12 27

Please advise, in the meantime, I can try opening a PR

Integrating via SPM fails to compile with multiple errors

I'm attempting to integrate using the new SPM integration steps but am encountering a couple build issues, even on a fresh project.

Steps to Reproduce:

  1. Create a brand new iOS project (using Storyboards vs SwiftUI)
  2. Follow the steps in the v3.6.0 release notes to add appboy-segment-ios via SPM (selecting the Full-SDK option)
  3. Add Segment dependency via SPM (v4.1.2)
  4. Build your app

I receive the following build errors:

In file included from /Users/.../SourcePackages/checkouts/appboy-segment-ios/Sources/Full-SDK/SEGAppboyHelper.m:2:
/Users/.../SourcePackages/checkouts/appboy-segment-ios/Sources/Full-SDK/SEGAppboyIntegration.h:8:44: error: no type or protocol named 'SEGIntegration'
@interface SEGAppboyIntegration : NSObject<SEGIntegration>
                                           ^
/Users/.../SourcePackages/checkouts/appboy-segment-ios/Sources/Full-SDK/SEGAppboyHelper.m:6:9: fatal error: 'Appboy-iOS-SDK/AppboyKit.h' file not found
#import "Appboy-iOS-SDK/AppboyKit.h"

Here's an fresh example project that produces the errors:
SegmentAppboySPM.zip

SPM Library Names Not Clear

The current library names are Full-SDK and Core, which lead to import statements such as import Full_SDK and import Core - these names give the reader no insight into what library is being imported.

A couple examples of library names that would clearly indicate what is being imported:

  • Full-SDK -> AppboySegment
  • Core -> AppboySegmentCore

Can a rename please be considered?

Missing arm64 symbols for appboy-ios-sdk and failing with Xcode 12

I have recently downloaded Xcode 12.4 and updated all my Pods to latest. One of Pod was having entry for segment

platform :ios, '14'
pod 'Segment-Appboy', '~> 3.3'

This Pod internally has dependency with appboy-ios-sdk, so once after pod install succeeded, building through Xcode gives below compile error for build target appboy-ios-sdk:

ld: in /Pods/Appboy-iOS-SDK/AppboyKit/libAppboyKitLibrary.a(ABKInAppMessageHTMLBase.o), building for iOS Simulator, but linking in object file built for iOS, file '//AppboyKit/libAppboyKitLibrary.a' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Which Segment pod version should I connect to support iOS 14 and XCode 12 ?

Ref: Appboy/appboy-ios-sdk#245

Carthage support moving forward

Hey folks,

Noticed the last two updates to the SDK do not include Carthage support but the CHANGELOG indicates a reintroduction will happen in a future version. Is there a timeline for when this will occur?

XCode 9: Main Thread Checker: ../Pods/Segment-Appboy/Pod/Classes/SEGAppboyIntegration.m: runtime: UI API called from background thread: -[UIApplication delegate] must be used from main thread only

Hey,

Using the 1.0.4 version with XCode 9 on iOS 11 .

This is the backtrace I got:

Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]
PID: 503, TID: 48849, Thread name: (none), Queue name: io.segment.analytics, QoS: 0
Backtrace:
4   Segment_Appboy                      0x0000000103544040 -[SEGAppboyIntegration applicationDidFinishLaunching:] + 112
5   CoreFoundation                      0x0000000182b876a0 <redacted> + 144
6   CoreFoundation                      0x0000000182a66820 <redacted> + 292
7   CoreFoundation                      0x0000000182a6b22c <redacted> + 60
8   Analytics                           0x0000000101adefac -[SEGIntegrationsManager invokeIntegration:key:selector:arguments:options:] + 952
9   Analytics                           0x0000000101adeab8 __60-[SEGIntegrationsManager forwardSelector:arguments:options:]_block_invoke + 144
10  CoreFoundation                      0x0000000182a4e6cc <redacted> + 232
11  Analytics                           0x0000000101ade95c -[SEGIntegrationsManager forwardSelector:arguments:options:] + 316
12  Analytics                           0x0000000101adfa94 __78-[SEGIntegrationsManager callIntegrationsWithSelector:arguments:options:sync:]_block_invoke + 120
13  Analytics                           0x0000000101ad4e3c __seg_dispatch_specific_block_invoke + 60
14  libdispatch.dylib                   0x00000001042e949c _dispatch_call_block_and_release + 24
15  libdispatch.dylib                   0x00000001042e945c _dispatch_client_callout + 16
16  libdispatch.dylib                   0x00000001042f8110 _dispatch_queue_serial_drain + 692
17  libdispatch.dylib                   0x00000001042ec9a4 _dispatch_queue_invoke + 332
18  libdispatch.dylib                   0x00000001042f9104 _dispatch_root_queue_drain_deferred_wlh + 424
19  libdispatch.dylib                   0x0000000104300100 _dispatch_workloop_worker_thread + 652
20  libsystem_pthread.dylib             0x00000001827aafe0 _pthread_wqthread + 932
21  libsystem_pthread.dylib             0x00000001827aac30 start_wqthread + 4

Thanks,

No Carthage Support

Carthage support would be helpful, even if the framework is only available as a precompiled download.

Most integer types silently ignored by identify

for (NSString *key in payload.traits.allKeys) {
    if (![appboyTraits containsObject:key]) {
      id traitValue = payload.traits[key];
      if ([traitValue isKindOfClass:[NSString class]]) {
      [[Appboy sharedInstance].user setCustomAttributeWithKey:key andStringValue:traitValue];
        SEGLog(@"[[Appboy sharedInstance].user setCustomAttributeWithKey: andStringValue:]");
      } else if ([traitValue isKindOfClass:[NSNumber class]]) {
        if (strcmp([traitValue objCType], [@(YES) objCType]) == 0) {
          [[Appboy sharedInstance].user setCustomAttributeWithKey:key andBOOLValue:[(NSNumber *)traitValue boolValue]];
          SEGLog(@"[[Appboy sharedInstance].user setCustomAttributeWithKey: andBOOLValue:]");
        } else if (strcmp([traitValue objCType], @encode(int)) == 0) {
          [[Appboy sharedInstance].user setCustomAttributeWithKey:key andIntegerValue:[(NSNumber *)traitValue integerValue]];
          SEGLog(@"[[Appboy sharedInstance].user setCustomAttributeWithKey: andIntegerValue:]");
        } else if (strcmp([traitValue objCType], @encode(double)) == 0) {
          [[Appboy sharedInstance].user setCustomAttributeWithKey:key andDoubleValue:[(NSNumber *)traitValue doubleValue]];
          SEGLog(@"[[Appboy sharedInstance].user setCustomAttributeWithKey: andDoubleValue:]");
        } else {
          SEGLog(@"Could not map NSNumber value to Appboy custom attribute:%@]", traitValue);
        }
      }
    }
  }

This code will not be able to map any integer type that isn't cast to an int type, this includes longs and NSIntegers, basically most of the integer types that are used in iOS programming.

`"Appboy-iOS-SDK/AppboyKit.h" file not found` with cocoapods 1.0.0.beta.6

Hey there!

I get the following error when building with cocoapods 1.0.0.beta.6 dependencies:

"Appboy-iOS-SDK/AppboyKit.h" file not found

which refers to this line: https://github.com/Appboy/appboy-segment-ios/blob/master/Pod/Classes/SEGAppboyIntegration.m#L2

My pod version is 1.0.0 (not the latest), but those lines are unchanged in the last version so I believe it doesn't matter here.

Temporary fix (notice the underscores):

-#import "Appboy-iOS-SDK/AppboyKit.h"
-#import "Appboy-iOS-SDK/ABKUser.h"
+#import <Appboy_iOS_SDK/AppboyKit.h>
+#import <Appboy_iOS_SDK/ABKUser.h>

Example in a Podfile:

post_install do |installer|
    # Workaround https://github.com/Appboy/appboy-segment-ios/issues/4
    path = "./Pods/Segment-Appboy/Pod/Classes/SEGAppboyIntegration.m"
    File.chmod(0644, path)
    File.write(path, File.open(path, &:read)
        .gsub('#import "Appboy-iOS-SDK/AppboyKit.h"', "#import <Appboy_iOS_SDK/AppboyKit.h>")
        .gsub('#import "Appboy-iOS-SDK/ABKUser.h"', "#import <Appboy_iOS_SDK/ABKUser.h>")
    )
end

[Request] Update to Analytics-iOS 4.1.2

Our project is experiencing this crash which has since been fixed in 4.1.2 of the Analytics-iOS library. When will an update to this library be available? Thank you so much! Normally I would wait and watch, but we're trying to get a release out the door and any sort of timeline will help!

Binary Project Specification for Carthage

After trying to use the new Carthage support, it wasn't until I tried to checkout and build the dependency with Carthage that I realised it doesn't support building with Carthage.

*** Skipped building appboy-ios-sdk due to the error:
Dependency "appboy-ios-sdk" has no shared framework schemes for any of the platforms: iOS

If you believe this to be an error, please file an issue with the maintainers at https://github.com/appboy/appboy-ios-sdk/issues/new
*** Skipped building appboy-segment-ios due to the error:
Dependency "appboy-segment-ios" has no shared framework schemes for any of the platforms: iOS

If you believe this to be an error, please file an issue with the maintainers at https://github.com/appboy/appboy-segment-ios/issues/new

It would be great if you could provide and manage a Binary Project Specification and consider updating the read me to mention that the dependency binary download only.
https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#binary-project-specification

Full pod fights Xcode settings and always dirties git

Summary:
When I install the full pod:
pod "Segment-Appboy"

It modifies a bunch of settings in the project. If I commit these changes and open Xcode, then Xcode modifies a bunch of settings back...

patch.txt

Critical Issue:
Our CI continuously fails b/c we try to upload a build after pod installing, but it dirties git and the upload fails.

Steps:

  1. Create a single app project
  2. Create a Podfile
  3. Add "Segment-Appboy" to the Podfile
  4. Run pod install
  5. Commit all changes
  6. Open workspace in Xcode 11.3 or 11.2
  7. Check 'git status'
  8. A number of lines have changed in the 'Pods/Pods.xcodeproj/project.pbxproj'
  9. Commit all changes
  10. Repeat 4-9 to see Xcode and the appboy pod continually fight over the Pods.xcodeproj settings

Context:
This does not ever happen with other pods.
This does not happen with "Segment-Appboy/Core"

Suggested fix:
Replicate the settings for the Core pod into the main SDK pod.

I have a test project zip, but cannot upload it to GitHub due to size

ld: symbol(s) not found for architecture x86_64

I'm trying to add Segment-appboy integration, and after having issues with headers, which refused to work, now I have issue with linker:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_Appboy", referenced from:
      objc-class-ref in SEGAppboyIntegration.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

My headers:

#import <Analytics/SEGAnalytics.h>
#import <Segment_Appboy/SEGAppboyIntegrationFactory.h>
#import <Appboy.h>

My code:

NSString *key = [APIManager sharedInstance].developMode ? kSegmentStagingKey : kSegmentProductionKey;
        SEGAnalyticsConfiguration *configuration = [SEGAnalyticsConfiguration configurationWithWriteKey:key];
        configuration.trackApplicationLifecycleEvents = YES; // Enable this to record certain application events automatically!
        [configuration use:[SEGAppboyIntegrationFactory instance]];
        [SEGAnalytics setupWithConfiguration:configuration];

My podfile:

platform :ios, '9.0'
use_frameworks!

inhibit_all_warnings!

abstract_target 'Core' do
    //omitted
    pod 'Analytics', '~> 3.0'
    pod 'Segment-Appboy'

    target 'myTarget' do
	end   
end
    
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|

      # Configure Pod targets for Xcode 8 compatibility
      config.build_settings['SWIFT_VERSION'] = '3.0'
      
    end
  end
end

My main issue is that in Segment integration guide there is no mention of what headers to include, I did the same as in example app, but they fail to compile in my project, probably due to use_frameworks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.