Giter Club home page Giter Club logo

atinternet-apple-sdk's People

Contributors

bloxidge avatar choli avatar cloiz avatar fzehana avatar ghugues avatar igortiukavkin avatar nsagnett avatar piano-analytics avatar simgui avatar toto avatar

Stargazers

 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

atinternet-apple-sdk's Issues

Crash when using offline mode

Hello :)
For some time now my app uses ATInternet v2.8.9 with offline mode.
I've recently decided to update the SDK with the latest version (2.11.2) but now the app crashes at start because of the offline mode :(

Here is the way I setup ATInternet:

let tracker = ATInternet.sharedInstance.defaultTracker

    tracker.setConfig(
      [ TrackerConfigurationKeys.Secure: "true",
        TrackerConfigurationKeys.Site: ATInternetTagging.siteId,
        TrackerConfigurationKeys.Log: ATInternetTagging.logServer,
        TrackerConfigurationKeys.LogSSL: ATInternetTagging.logSercureServer,
        TrackerConfigurationKeys.HashUserId: "false",
        TrackerConfigurationKeys.Identifier: IdentifierTypeKey.idfv.rawValue,
        TrackerConfigurationKeys.OfflineMode: OfflineModeKey.required.rawValue],
    override: false)

The app crashes in Storage.swift l115 with a Fatal error: Unexpectedly found nil while unwrapping an Optional value

let managedObjectModel: NSManagedObjectModel? = {
        let bundle = Bundle(for: Tracker.self)
        let modelPath = bundle.path(forResource: "Tracker", ofType: "momd")
        let modelURL = URL(fileURLWithPath: modelPath!) // <- here is the bad boy
        
        return NSManagedObjectModel(contentsOf: modelURL)
    }()

I've tried to delete the app and reinstall it, still crashes.
Note that it doesn't crash if I don't use the offline mode option in my tracker configuration.

More env infos: Xcode 10.1.0, iOS simulator 12.1.

Problem with serialization with string of type "[8.8]" when preparing query

Hi,

screen shot 2017-08-10 at 17 21 33

when serializing number such as "[8.8]", your method "parseJSON" in the class "Builder" returns any which is, I suspect, afterwise cast as Array of Float64 (or double) which results in transforming "8.8" to "8.80000000001"

Is it possible that you check the type of the serialized object in order to return the correct result ?

ty !

TrackerConfigurationKeys not available in Objective-C

The documentation says:

Samples to use constants (all constants are available in TrackerConfigurationKeys in Swift, prefixed by AT_CONF_ in Objective-C)

But this is actually not true since 2.5.0. Configuration keys like AT_CONF_SITE are not available in Objective-C.

Since Xcode 8, Objective-C supports class properties. So simply making TrackerConfigurationKeys inherit from NSObject would solve the issue:

public class TrackerConfigurationKeys: NSObject {
...

Objective -C code can now use the configuration keys with the same syntax like Swift:

TrackerConfigurationKeys.Site

Floods the log with CoreTelephony error

Failed to create synchronous remote object proxy: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated.}

Carthage Support

Hello,

When do you think Carthage support will be available ?

Thank you !

Best,
Morgan

ATInternet crashes on screen rotate

Looking at crash reports, it seems that a large number of users are experiencing crashes because of our usage of ATInternet-apple-sdk (version 2.8.6) when they rotate their devices.
The crashes are caused by the force unwrapping of optionals in ScreenOperation.swift, line 51:
ATInternet.sharedInstance.defaultTracker.socketSender!.sendMessage(rotationEvent.description)
Since there are places in the library where optional chaining is used for socketSender and others where it is forced unwrapped just to call methods which do not return anything, could you please use optional chaining everywhere socketSender is concerned?
It seems that there are cases out there in the wild where it will be nil.
Thanks!

Carthage support

Carthage support was announced in October 2016 to be available soon. When can it be expected to be available?

Database path

Currently, except for tvOS, database path is document directory.

But documents are automatically stored for iCloud backup.

And it's not really secured. Especially with GDPR requirements.

Is it possible to use:

  • custom path?
  • cache path for everyone?

Thanks.

Won't Build using Xcode 11

Hi, in preparation of soon iOS 13 release I tried to build my app using Xcode Version 11.0 beta 5 (11M382q). I'm using cocoapods V.1.7.5 and ATInternet-Apple-SDK (2.14.4). When building I get the following compiler error:

<module-includes>:1:9: note: in file included from <module-includes>:1: #import "Headers/ATInternet-Apple-SDK-umbrella.h"
Pods/Target Support Files/ATInternet-Apple-SDK/ATInternet-Apple-SDK-umbrella.h:19:9: note: in file included from /Users/raimar/Xcode/faz-.net-ios/Der_Tag/Pods/Target Support Files/ATInternet-Apple-SDK/ATInternet-Apple-SDK-umbrella.h:19: #import "watchOSTracker.h"
Pods/ATInternet-Apple-SDK/ATInternetTracker/Sources/watchOSTracker.h:24:9: error: 'WatchKit/WatchKit.h' file not found #import <WatchKit/WatchKit.h>
<unknown>:0: error: could not build Objective-C module 'Tracker'

Any help appreciated! Thanks for your support!

Using .enableAutoTracking = true prevents the app from going in background

Hello. My company is required to use this library for analytics and screen tracking purposes, and as I was profiling our app today, I've noticed that when ATInternet.sharedInstance.defaultTracker. enableAutoTracking is enabled (set to true), the app does not sleep when entering background.

I know this since I see that CPU usage does not fall to 0 when the app enters background, which is what iOS Apps normally do when they enter background (unless background app refresh is enabled, which is not enabled in our case).

Is this bug with the SDK? If this is a feature it should be documented very clearly since it is overriding the default iOS app behaviour that any developer expects from their apps.

For now I've disabled enableAutoTracking, since it was causing a lot of battery drain when our app was in the background. Thank you for your time.

P.S.: Tested using the latest release of this library through CocoaPods (ATInternet-Apple-SDK 2.11.2)

@objc Methods Renamings with 2 or More Parameters Miss Parameter Names

Many of the Swift methods are renamed for Objective-C, which is a good thing. The way it's done is less than ideal, because the names of the parameters are lost at call site.

E.g.:

@objc(addScreenWith2Chapters:::::)
public func add(_ screenId: String, update: Date,name: String, chapter1: String, chapter2: String) -> DynamicScreen {

At call site this looks like this:

[tracker.dynamicScreens addScreenWith2Chapters:@"sid" :[NSDate date] :@"n" :@"c1" :@"c2"];

This does not make any sense. The renamed method signature should include a parameter name for every parameter:

@objc(addScreenWith2Chapters:update:name:chapter1:chapter2:)

Then the method call from Objective-C makes much more sense:

[tracker.dynamicScreens addScreenWith2Chapters:@"sid" update:[NSDate date] name:@"n" chapter1:@"c1" chapter2:@"c2"];

There are 20 occurrences of this problem in this library.

Crash: EXC_BAD_ACCESS KERN_INVALID_ADDRESS

We see these two crashes in Crashlytics but we cannot reproduce them. Do you know where this is coming from, what we could change to fix it? Do you think they are not related even though the same crash reason?

0Crashed: com.apple.main-threadEXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000 Raw Text
0 | libswiftCore.dylib | swift_isUniquelyReferenced_nonNull_native + 10
1 | App | <compiler-generated> line 0specialized Tracker.processSetParam(_:value:options:)
2 | App | Tracker.swift line 817specialized Tracker.setParam(_:value:options:) + 817
3 | App | <compiler-generated> line 0CustomVar.setParams()
4 | App | <compiler-generated> line 0AbstractScreen.setParams()
5 | App | <compiler-generated> line 0Dispatcher.dispatch(:)
6 | App | <compiler-generated> line 0AbstractScreen.sendView()

and the second one:
0Crashed: com.apple.main-threadEXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000 Raw Text
0 | App | <compiler-generated> line 0specialized Tracker.processSetParam(:value:options:)
1 | App | <compiler-generated> line 0specialized Tracker.handleNotStringParameterSetting(:value:options:)
2 | App | <compiler-generated> line 0Dispatcher.dispatch(:)
3 | App | <compiler-generated> line 0AbstractScreen.sendView()

If you are interested in more information let me know.

Crash when tracker.identifiedVisitor.set()

Hi,

I have a recurring crash on my application.
The problem seems to happen when I call too often (maybe too quickly) the tracker.identifiedVisitor.set().

Here my class calling your SDK:

import Tracker

@objc
class ATInternetMarker: NSObject, Marker {

    // Singleton
    static let shared = ATInternetMarker()

    static func configure() {
        _ = ATInternetMarker.shared
    }

    private let tracker: Tracker

    // Called when app is launched
    override private init() {
        tracker = ATInternet.sharedInstance.tracker(name: "MY_PROJECT",
                                                    configurationFileName: "ATInternetConfiguration")

        super.init()

        if APPMANAGER.functionalityManager.isEnabled(LCDRFunctionalityTypeATInternet) == false {
            return
        }

        tracker.delegate = self
    }

    // Called on completion of every network call
    func handle(markingData data: [String: Any]) {
        if APPMANAGER.functionalityManager.isEnabled(LCDRFunctionalityTypeATInternet) == false {
            return
        }

        guard let configuration = ATInternetAPIConfiguration(dictionary: data) else {
            Logger.d("ERROR: Impossible to handle ATInternet server informations for \(data)")
            return
        }

        tracker.setSiteId(configuration.tracker.site) { isSet in
            Logger.v("siteId \(isSet)")
        }
        tracker.setLog(configuration.tracker.log) { isSet in
            Logger.v("log \(isSet)")
        }
        tracker.setSecuredLog(configuration.tracker.logSSL) { isSet in
            Logger.v("logSSL \(isSet)")
        }

        if let identifiedVisitor = configuration.identifiedVisitor {
            tracker.identifiedVisitor.set(identifiedVisitor.id,
                                          visitorCategory: identifiedVisitor.category)
        }

        var screen: Screen!
        let chapter1 = configuration.page.chapter1
        let chapter2 = configuration.page.chapter2
        let chapter3 = configuration.page.chapter3

        if chapter1 == nil {
            screen = tracker.screens.add(configuration.page.name)
        } else if chapter2 == nil {
            screen = tracker.screens.add(configuration.page.name, chapter1: chapter1!)
        } else if chapter3 == nil {
            screen = tracker.screens.add(configuration.page.name, chapter1: chapter1!, chapter2: chapter2!)
        } else {
            screen = tracker.screens.add(configuration.page.name, chapter1: chapter1!, chapter2: chapter2!, chapter3: chapter3!)
        }

        if let internalSearchKeyword = configuration.internalSearch?.keyword {
            screen.internalSearch = InternalSearch(keyword: internalSearchKeyword, resultScreenNumber: 1)
        }
        screen.level2 = configuration.page.level2
        configuration.page.customVars.forEach { customVar in
            screen.customVars.add(customVar.key, value: customVar.value, type: .app)
        }

        screen.sendView()
    }
}

And the stack trace:

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
    frame #0: 0x00000001df414d70 libobjc.A.dylib`objc_msgSend + 16
    frame #1: 0x00000001063b5264 libswiftCore.dylib`Swift.Dictionary._Variant.subscript.getter : (A) -> Swift.Optional<B> + 148
    frame #2: 0x0000000103666910 MY_PROJECT`IdentifiedVisitor.save(keyParameter="an", keyPersistent="ATIdentifiedVisitorNumeric", value="400184797", self=0x000000028049bcc0) at IdentifiedVisitor.swift:149:55
    frame #3: 0x0000000103666734 MY_PROJECT`IdentifiedVisitor.save(keyParameter="an", keyPersistent="ATIdentifiedVisitorNumeric", value=400184797, self=0x000000028049bcc0) at IdentifiedVisitor.swift:140:9
    frame #4: 0x0000000103665cd8 MY_PROJECT`IdentifiedVisitor.set(visitorId=400184797, self=0x000000028049bcc0) at IdentifiedVisitor.swift:69:9
    frame #5: 0x0000000103665e2c MY_PROJECT`IdentifiedVisitor.set(visitorId=400184797, visitorCategory=16, self=0x000000028049bcc0) at IdentifiedVisitor.swift:83:13
  * frame #6: 0x00000001033284c8 MY_PROJECT`closure #1 in ATInternetMarker.handle(self=0x0000000280602bf0, configuration=0x0000000283311d90) at ATInternetMarker.swift:62:48
    frame #7: 0x00000001030bde04 MY_PROJECT`thunk for @escaping @callee_guaranteed () -> () at <compiler-generated>:0
    frame #8: 0x0000000106ed7840 libdispatch.dylib`_dispatch_call_block_and_release + 24
    frame #9: 0x0000000106ed8de4 libdispatch.dylib`_dispatch_client_callout + 16
    frame #10: 0x0000000106ee6a94 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 1360
    frame #11: 0x00000001e01be1bc CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
    frame #12: 0x00000001e01b9084 CoreFoundation`__CFRunLoopRun + 1964
    frame #13: 0x00000001e01b85b8 CoreFoundation`CFRunLoopRunSpecific + 436
    frame #14: 0x00000001e242c584 GraphicsServices`GSEventRunModal + 100
    frame #15: 0x000000020cab3558 UIKitCore`UIApplicationMain + 212
    frame #16: 0x0000000102e9d640 MY_PROJECT`main(argc=1, argv=0x000000016cf6b7d8) at main.m:16:16
    frame #17: 0x00000001dfc78b94 libdyld.dylib`start + 4

I tried to wrap my handle(markingData:) in a DispatchQueue.main.async but it still crash.

Can you help me ?

Thanks a lot !

iOS SDK compatibility issues.

Hello,

We're trying to release a build but testing on iOS 12 beta we get the following runtime error that crashes the app:

dyld: Symbol not found: __T0BOWV
Referenced from: /private/var/containers/Bundle/Application/0D4E3182-9580-4035-B8B3-0BCC4DD885AF/RTÉ Player.app/Frameworks/Tracker.framework/Tracker
Expected in: /private/var/containers/Bundle/Application/0D4E3182-9580-4035-B8B3-0BCC4DD885AF/RTÉ Player.app/Frameworks/libswiftCore.dylib
in /private/var/containers/Bundle/Application/0D4E3182-9580-4035-B8B3-0BCC4DD885AF/RTÉ Player.app/Frameworks/Tracker.framework/Tracker

When will there be a release of the framework that supports iOS12 and can be built using either Xcode 10 and Xcode 9?

Crash in ATInternet-Apple-SDK/Tracker (= 2.9.8) in Lifecycle.swift:298

We have the following crash report in Crashlytics, in our app using ATInternet-Apple-SDK/Tracker (= 2.9.8). Can you please fix it?

  • Date: 2018-11-08T08:33:00Z
  • OS Version: 11.3.1 (15E302)
  • Device: iPhone 7
  • RAM Free: 4.6%
  • Disk Free: 5%

#8. Crashed: TrackerQueue (QOS: BACKGROUND)
0 libobjc.A.dylib 0x1801201a0 objc_retain + 16
1 Point de vente 0x103160578 $S7Tracker9LifeCycleC10getMetricsSSycyFZSSycfU_Tf4d_n (LifeCycle.swift:298)
2 Point de vente 0x10317688c $SSSIego_ytSSIegnr_TR ()
3 Point de vente 0x103126f74 $S7Tracker7BuilderC12prepareQuerySaySS3key_SS_SSt5valuetGyF (Builder.swift:412)
4 Point de vente 0x1031244a8 $S7Tracker7BuilderC5buildSaySSGyF (Builder.swift:163)
5 Point de vente 0x103126190 $S7Tracker7BuilderC4mainyyFyyXEfU_ (Builder.swift:309)
6 Point de vente 0x10318ff48 $Ss5Error_pIgzo_ytsAA_pIegrzo_TR ()
7 Point de vente 0x10312b630 $Ss5Error_pIgzo_ytsAA_pIegrzo_TRTA ()
8 libswiftObjectiveC.dylib 0x104f86e34 autoreleasepool(invoking:) + 4329270836
9 Point de vente 0x103126520 $S7Tracker7BuilderC4mainyyFTo ()
10 Foundation 0x1818b3cac -[__NSOperationInternal _start:] + 848
11 Foundation 0x18197476c __NSOQSchedule_f + 404
12 libdispatch.dylib 0x18083cae4 _dispatch_client_callout + 16
13 libdispatch.dylib 0x180844f18 _dispatch_continuation_pop$VARIANT$mp + 424
14 libdispatch.dylib 0x180843904 _dispatch_async_redirect_invoke$VARIANT$mp + 784
15 libdispatch.dylib 0x180849d30 _dispatch_root_queue_drain + 588
16 libdispatch.dylib 0x180849a80 _dispatch_worker_thread3 + 120
17 libsystem_pthread.dylib 0x180b6ffac _pthread_wqthread + 1176
18 libsystem_pthread.dylib 0x180b6fb08 start_wqthread + 4

Need for Swizzling ?

Hi,

Why do you need to do Swizzling with JRSwizzle ?
You cannot assume that you are the only one to swizzle method in our app and when multiple SDK do swizzling it can become pretty ugly pretty fast.

try self.jr_swizzleMethod(#selector(UIRefreshControl.beginRefreshing), withMethod: #selector(UIRefreshControl.at_beginRefreshing))
try self.jr_swizzleMethod(#selector(UIView.init(frame:)), withMethod: #selector(UIRefreshControl.at_initWithFrame(_:)))
try self.jr_swizzleMethod(#selector(UIResponder.touchesEnded), withMethod: #selector(UISwitch.at_touchesEnded(_:withEvent:)))
try self.jr_swizzleMethod(#selector(UISwitch.at_touchesEnded(_:withEvent:)), withMethod: #selector(UIResponder.touchesEnded))
try self.jr_swizzleMethod(#selector(UIViewController.viewWillTransition(to:with:)), withMethod: #selector(UIViewController.at_viewWillTransitionToSize(_:withTransitionCoordinator:)))
try self.jr_swizzleMethod(#selector(UIViewController.viewDidAppear(_:)), withMethod: #selector(UIViewController.at_viewDidAppear(_:)))
try self.jr_swizzleMethod(#selector(UIApplication.sendEvent(_:)), withMethod: #selector(UIApplication.at_sendEvent(_:)))
try self.jr_swizzleMethod(#selector(UIApplication.at_sendEvent(_:)), withMethod: #selector(UIApplication.sendEvent(_:)))

Please consider providing an API to do what you did with swizzling?
Can we disable all swizzling in your SDK?
We really do not want any kind of swizzling in our app.

Thanks

3 warnings in ATInternet SDK in current Xcode (9.4.1)

Step 1: Add the SDK to your Podfile: pod 'ATInternet-Apple-SDK/Tracker'
Step 2: Build. Three warnings in the SDK source code itself :

1/ ATReachability.swift:201:42: Plaform condition appears to be testing for simulator environment; use 'targetEnvironment(simulator)' instead

    private var isRunningOnDevice: Bool = {
        #if (arch(i386) || arch(x86_64)) && os(iOS)

2/ TechnicalContext.swift:131:96: Using '!' in this location is deprecated and will be removed in a future release; consider changing this to '?' instead

 `typealias sharedManagerCType = @convention(c) (AnyObject, Selector) -> AnyObject!`

3/ Tracker.swift:644:49: 'doNotTrack' is deprecated: Use ATInternet.optOut instead
if(!LifeCycle.isInitialized && !Tracker.doNotTrack) {

Dependency issue ?

Hi,

Can you add your open source dependencies in your Podspec ?
Because if my app has the same dependencies has your SDK it will conflict.

Dependencies :

  • JRSwizzle
  • KLCPopup
  • Reachability
  • SRWebSocket
  • SwiftyJSON

Thanks,

Better Support for Swift 4.2

Hi,

I have issue with your SDK when using Swift 4.2.

Please consider testing it with pod spec lint --allow-warnings --use-libraries --swift-version=4.2 --verbose ATInternet-Apple-SDK-Tracker.podspec in order to be sure your SDK won't cause any issue when implemented in a app that support Swift 4.2.
Adding this test to your CI will help a lot.

Swift 5 is around the corner please prepare your SDK for it.

Thanks,

podspec: add swift_version

Please add the swift_version to you podspec. This is new in CocoaPods 1.4.0. This allows a client project to use a different Swift compiler version, and the Xiti pod will be correctly compiled with its (older) Swift version.

Crash in `BackgroundTask.end(_:)`

This is crash log from Xcode.

Thread 32 Queue : TrackerQueue (QOS: BACKGROUND) (concurrent)
#0	0x00000001ae4d3190 in _os_unfair_lock_corruption_abort ()
#1	0x00000001ae4d32e4 in _os_unfair_lock_lock_slow ()
#2	0x00000001adae2b58 in objc_sync_enter ()
#3	0x00000001010e6a9c in BackgroundTask.end(_:) at /<path-to-code>/Pods/ATInternet-Apple-SDK/ATInternetTracker/Sources/BackgroundTask.swift:105
#4	0x00000001011bb234 in static Sender.sendOfflineHits(_:forceSendOfflineHits:async:) at /<path-to-code>/Pods/ATInternet-Apple-SDK/ATInternetTracker/Sources/Sender.swift:333
#5	0x00000001011b5e68 in Sender.send(_:) at /<path-to-code>/Pods/ATInternet-Apple-SDK/ATInternetTracker/Sources/Sender.swift:86
#6	0x00000001010f129c in closure #1 in Builder.main() at /<path-to-code>/Pods/ATInternet-Apple-SDK/ATInternetTracker/Sources/Builder.swift:322
#7	0x0000000100b39b70 in thunk for @callee_guaranteed () -> (@error @owned Error) ()
#8	0x00000001010f1384 in partial apply for thunk for @callee_guaranteed () -> (@error @owned Error) ()
#9	0x000000010458eec8 in autoreleasepool<A>(invoking:) ()
#10	0x00000001010f0f24 in Builder.main() at /<path-to-code>/Pods/ATInternet-Apple-SDK/ATInternetTracker/Sources/Builder.swift:306
#11	0x00000001010f13bc in @objc Builder.main() ()
#12	0x00000001af2765d8 in -[__NSOperationInternal _start:] ()
#13	0x00000001af377cdc in __NSOQSchedule_f ()
#14	0x0000000104702c28 in _dispatch_call_block_and_release ()
#15	0x00000001047041c0 in _dispatch_client_callout ()
#16	0x00000001047076b8 in _dispatch_continuation_pop ()
#17	0x0000000104706ab0 in _dispatch_async_redirect_invoke ()
#18	0x0000000104715210 in _dispatch_root_queue_drain ()
#19	0x0000000104715be4 in _dispatch_worker_thread2 ()
#20	0x00000001ae4d9bc0 in _pthread_wqthread ()
#21	0x00000001ae4dfdd4 in start_wqthread ()

Confused Integrating SmartTracker

I tried to follow the documentation to integrate the SmartTracker SDK. Marketing sent me this config file that they loaded from your portal I suppose:

import SmartTracker

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
   let tracker = ATInternet.sharedInstance.defaultTracker

   // If SmartTracker is downloaded from Github, uncomment the line below in order to enable Live Tagging
   // tracker.token = "***secret***"

   // Enable live tagging for configuration (disable when going to production)
   tracker.enableLiveTagging = true

   // Enable auto tracking (disabled by default, enable auto tracking whenever you want)
   tracker.enableAutoTracking = false
   return true
}

So I assume I have to import SmartTracker. I do this with cocoapods and copied this line from your docs: pod "ATInternet-Apple-SDK/SmartTracker",">=1.0"

The library gets integrated, but it states 102 warings. For example
/ATInternet-iOS-Swift-SDK/ATInternet-iOS-Swift-SDK-umbrella.h: warning: Missing file: /Pods/Target Support Files/ATInternet-iOS-Swift-SDK/ATInternet-iOS-Swift-SDK-umbrella.h is missing from working copy

And it can't find SmartTracker on import.

Can you make sure that your documentation is up to date please? What do I have to import to use the smart tracker sdk?

And is it really necessary to disable ATS for your domain?

'Tracker/Crash.h' file not found

I have this 'Tracker/Crash.h' file not found when I tried to compile your SDK with Cocoapods SDK version ATInternet-Apple-SDK/Tracker (2.8.9).

I'm trying Cocoapods 1.5.0 because it can improve significantly app start time https://twitter.com/alloy/status/972503674009288705.

Dans le fichier TrackerTests-Bridging-Header.h

Remplacer

#import <Tracker/Crash.h>
#import <Tracker/Hash.h>

Par

#import "Crash.h"
#import "Hash.h"

Argument for a subspec for ATInternet-Apple-SDK-SmartTracker.podspec

Hi @d-theo,

In order to reduce the size of our app, reduce the number of our dependencies and improve the pre-main loading of our app. Can you please consider make a subspec for ATInternet-Apple-SDK-SmartTracker.podspec that remove JRSwizzle,KLCPopup and Socket.IO-Client-Swift because we don't use feature related to these SDK.

We use ATInternet-Apple-SDK-SmartTracker in a very manual way so if we could have a subspec ATInternet-Apple-SDK-SmartTracker(Core) it would be awesome.

Thanks,

@available Versions Wrongly Used

@available can be used to make a method/class only available to some version of the target platform. This lib uses it wrongly:

@available(*, deprecated: 2.5.0, message: "location is now only available as a screen object property.")

This makes the method available until iOS 2.5.0, macOS 2.5.0 and watchOS 2.5.0. Probably not the intent here.

Crashes in Storage init()

I work on a project using this library (v2.8.6) using Swift 4.
I get quite a few crashes (over 30) from users with the following details:
Thread 21 name:
Thread 21 Crashed:
0 libswiftCore.dylib 0x000000010669b95c 0x1064bc000 + 1964380
1 libswiftCore.dylib 0x000000010669b95c 0x1064bc000 + 1964380
2 libswiftCore.dylib 0x000000010654b988 0x1064bc000 + 588168
3 Tracker 0x0000000103f92f9c Storage.init() + 2084 (Storage.swift:99)
4 Tracker 0x0000000103f92608 globalinit_33_AE324FFDA07A1D8EBA580BEF2FFC381F_func47 + 72 (Storage.swift:0)

Looking at the code, the forced try! after a failed DB migration seems to be the problem.
I would also like to mention that throwing a fatalError() from a library doesn't look good, as those using it have no chance of recovery from errors.
Is there a workaround for this or do you plan to provide a fix in the future?

Support Sementic Versionning PLEASE 😭🙏

Please please please consider support proper sementic versioning.

Because now your minor update break the API and my implementation.

Why does a minor update 1.0.8 break my code ?

no visible @interface for 'Tracker' declares the selector 'setSiteId:completionHandler:'
    [_tracker setSiteId:xitiSiteID.intValue completionHandler:nil];
     ~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
no visible @interface for 'Tracker' declares the selector 'setSecureModeEnabled:completionHandler:'
    [_tracker setSecureModeEnabled:YES completionHandler:nil];
     ~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
no visible @interface for 'Tracker' declares the selector 'setLog:completionHandler:'
    [_tracker setLog:at_log completionHandler:nil];
     ~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
no visible @interface for 'Tracker' declares the selector 'setSecuredLog:completionHandler:'
    [_tracker setSecuredLog:at_logSSL completionHandler:nil];
     ~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
no visible @interface for 'Tracker' declares the selector 'setDomain:completionHandler:'
    [_tracker setDomain:at_logDomain completionHandler:nil];
     ~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
no visible @interface for 'Tracker' declares the selector 'setStringParam::'
  [_tracker setStringParam:key :[value addingPercentEncoding]];
   ~~~~~~~~ ^~~~~~~~~~~~~~
6 errors generated.

SmartTracker iOS doesn't compile with carthage

kenji@macboo:/tmp/atissue $ carthage update
*** Fetching atinternet-apple-sdk
*** Checking out atinternet-apple-sdk at "2.13.0"
*** xcodebuild output can be found in /var/folders/7v/dfg0p2vj1z58n65d99l2n1lh0000gp/T/carthage-xcodebuild.eo4rZJ.log
*** Building scheme "SmartTracker iOS" in ATAnalytics.xcworkspace
Build Failed
	Task failed with exit code 65:
	/usr/bin/xcrun xcodebuild -workspace /private/tmp/toto/Carthage/Checkouts/atinternet-apple-sdk/ATAnalytics.xcworkspace -scheme SmartTracker\ iOS -configuration Release -derivedDataPath /Users/kenji/Library/Caches/org.carthage.CarthageKit/DerivedData/10.1_10B61/atinternet-apple-sdk/2.13.0 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/7v/dfg0p2vj1z58n65d99l2n1lh0000gp/T/atinternet-apple-sdk SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /tmp/toto/Carthage/Checkouts/atinternet-apple-sdk)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/7v/dfg0p2vj1z58n65d99l2n1lh0000gp/T/carthage-xcodebuild.eo4rZJ.log

kenji@macboo:/tmp/atissue $ cat Cartfile
github "at-internet/atinternet-apple-sdk" ~> 2.8

In the log file:

.../Carthage/Checkouts/atinternet-apple-sdk/ATInternetTracker/Sources/Tracker.swift:583:55: error: use of undeclared type 'ECommerce'
    @objc fileprivate(set) public lazy var ecommerce: ECommerce = ECommerce(tracker: self)
                                                      ^~~~~~~~~
.../Carthage/Checkouts/atinternet-apple-sdk/ATInternetTracker/Sources/Tracker.swift:632:56: error: use of undeclared type 'MvTestings'
    @objc fileprivate(set) public lazy var mvTestings: MvTestings = MvTestings(tracker: self)

and 111 warnings (assuming 1 percent of them will provoque an error... 1.1 errors...)

@discardableResult

Many methods return a value that is rarely used at the call site. (e.g. public func unset() -> Tracker).

Right now the caller has to silence the warning by assigning it to an unused variable:

Swift:
_ = tracker.identifiedVisitor.unset()

Objective-C:
__unused Tracker *t = [tracker.identifiedVisitor unset];

It would be helpful to annotate such methods with @discardableResult. Then the caller does not get a warning/error if the variable is not assigned to a variable.

Obj-C project doesn't build

I have a obj-c project and tried to integrate the 2.15 Library or 2.15.1 library

  • added with cocoa pods > doesn't work
  • added tracker with Tracker.framework > doesn't work

It always shows this error:

Bildschirmfoto 2019-09-02 um 15 14 10

I've tried all guidelines on how to combine swift code with obj-c projects, but it just has no impact. Also it makes no difference if I use Xcode 11 or Xcode 10.3. Any suggestions?

Memory issues with CustomVars and RichMedia

Hallo,

I had two problems with cycles using this library:

  1. In function @objc public func sendPlay(dynamicRefreshConfiguration: [Int: Int]), line with
self.chronoRefresh = DynamicRefresher(configuration: config) {
            self.sendRefresh()
}

I think here should be [weak self] because this block retains RichMedia object, which has strong reference to DynamicRefresher object.

  1. In CustomVars class, var screen: AbstractScreen! is defined. I think it should be weak var screen: AbstractScreen!, otherwise we get leak because CustomVars is retaining AbstractScreen and vice verse.

What do you think about it?

ATInternet-Apple-SDK/watchOSTracker 2.15.1 on Watch OS 5

Hi,
I'm using ATInternet using pod:

target 'WatchApp Extension' do
platform :watchos, '5.0'
use_frameworks!
pod 'ATInternet-Apple-SDK/watchOSTracker'
end

The version used is the last one: 2.15.1

All is working fine on WatchOS 6, but on WatchOS 5 the app won't launch:

dyld: lazy symbol binding failed: Symbol not found: _WKExtensionMain

Removing the pod 'ATInternet-Apple-SDK/watchOSTracker' fix the issue and the app runs again on WatchOS 5.

Is this a known issue ?

Regards.

Error compiling in Xcode 8.2 with swift 3.0

Hi, I have just tried to integrate the SmartTracker with cocoa pods:
pod "ATInternet-Apple-SDK/SmartTracker", '1.0.3'

Unfortunately, when building in Xcode 8.2 and swift 3.0 I get the following error:

/Users/me/Documents/Project/myProject/Pods/ATInternet-Apple-SDK/ATInternetTracker/Sources/UILabelExtension.swift:44:17: Heterogenous collection literal could only be inferred to '[String : Any]'; add explicit type annotation if this is intentional

Hardcoded Static framework

Hello!

We are trying to add the ATInternet SDK as a cocoapods dependency of one of our SDK and we can't because it specifies static_framework = true in its Podfile.

Is there any specific reason for this? The code is built from source so building a dynamic framework should not raise an issue?

Thanks!
Guillaume

'ParamType' is not a member type of 'Param'

@d-theo I have this 93 issues with the last version of the SDK it does not build. Does the SDK run at least once in a CI before deployment?

/ATInternet-Apple-SDK/ATInternetTracker/Sources/Tracker.swift:740:89: 'ParamType' is not a member type of 'Param'

Expose sdkVersion

Is there a way to access the sdkVersion. I didn't find any so far.

If not, is there a reason, why it's not exposed for public access?

Won't build from 2.10 to 2.13

We're migrating our app to Swift 4.2.

Here is the full xcode log:

/.../Pods/ATInternet-Apple-SDK/ATInternetTracker/Sources/Dispatcher.swift:119:23: error: use of unresolved identifier 'Crash'
        let report = (Crash.compute() as NSDictionary?) as! [String: Any]?
                      ^~~~~
ObjectiveC.NSObject:102:14: note: did you mean 'hash'?
    open var hash: Int { get }
             ^
ObjectiveC.NSObject:4:17: note: did you mean 'hash'?
    public func hash(into hasher: inout Hasher)
                ^
CoreFoundation.CFHash:1:13: note: did you mean 'CFHash'?
public func CFHash(_ cf: CFTypeRef!) -> CFHashCode
            ^
/.../Pods/ATInternet-Apple-SDK/ATInternetTracker/Sources/Screen.swift:212:9: error: use of unresolved identifier 'Crash'
        Crash.lastScreen(builtScreenName)
        ^~~~~
ObjectiveC.NSObject:102:14: note: did you mean 'hash'?
    open var hash: Int { get }
             ^
ObjectiveC.NSObject:4:17: note: did you mean 'hash'?
    public func hash(into hasher: inout Hasher)
                ^
CoreFoundation.CFHash:1:13: note: did you mean 'CFHash'?
public func CFHash(_ cf: CFTypeRef!) -> CFHashCode
            ^
/.../Pods/ATInternet-Apple-SDK/ATInternetTracker/Sources/StringExtension.swift:53:16: error: use of unresolved identifier 'Hash'; did you mean 'hash'?
        return Hash.sha256Value("AT" + self)
               ^~~~
               hash
Swift.String:2:17: note: 'hash' declared here
    public func hash(into hasher: inout Hasher)
                ^
Swift.StringProtocol:2:17: note: 'hash' declared here
    public func hash(into hasher: inout Hasher)
                ^
Foundation.StringProtocol:20:16: note: 'hash' declared here
    public var hash: Int { get }
               ^
/.../Pods/ATInternet-Apple-SDK/ATInternetTracker/Sources/Tracker.swift:1512:22: error: use of unresolved identifier 'Crash'
        if let map = Crash.recover() as? [String : Any] {
                     ^~~~~
ObjectiveC.NSObject:102:14: note: did you mean 'hash'?
    open var hash: Int { get }
             ^
ObjectiveC.NSObject:4:17: note: did you mean 'hash'?
    public func hash(into hasher: inout Hasher)
                ^
CoreFoundation.CFHash:1:13: note: did you mean 'CFHash'?
public func CFHash(_ cf: CFTypeRef!) -> CFHashCode
            ^
/.../Pods/ATInternet-Apple-SDK/ATInternetTracker/Sources/Tracker.swift:1595:21: error: use of unresolved identifier 'Crash'
                    Crash.handle()
                    ^~~~~
ObjectiveC.NSObject:95:21: note: did you mean 'hash'?
    open class func hash() -> Int
                    ^
ObjectiveC.NSObject:4:17: note: did you mean 'hash'?
    public func hash(into hasher: inout Hasher)
                ^
CoreFoundation.CFHash:1:13: note: did you mean 'CFHash'?
public func CFHash(_ cf: CFTypeRef!) -> CFHashCode

Crash in 1.0.7 - BUG IN CLIENT OF LIBDISPATCH: trying to lock recursively

This crash happen a lot on startup.

Why does your tracker embed font ?

{"app_name":"<project_name>","timestamp":"2017-05-04 00:45:43.29 +0200","app_version":"8.6","slice_uuid":"4057e744-320a-3ac5-8923-5f3bc6178687","adam_id":0,"build_version":"1610031500","bundleID":"<bundle_id>","share_with_app_devs":true,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 10.3.1 (14E304)","incident_id":"23F7ABC4-4238-40E8-B5E1-CC1CC2ED5AC4","name":"<project_name>"}
Incident Identifier: 23F7ABC4-4238-40E8-B5E1-CC1CC2ED5AC4{"app_name":"<project_name>","timestamp":"2017-05-04 00:45:43.29 +0200","app_version":"8.6","slice_uuid":"4057e744-320a-3ac5-8923-5f3bc6178687","adam_id":0,"build_version":"1610031500","bundleID":"<bundle_id>","share_with_app_devs":true,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 10.3.1 (14E304)","incident_id":"23F7ABC4-4238-40E8-B5E1-CC1CC2ED5AC4","name":"<project_name>"}
Incident Identifier: 23F7ABC4-4238-40E8-B5E1-CC1CC2ED5AC4
CrashReporter Key:   89e10780ec2d7b94591ee6aa402d4449adcecfa1
Hardware Model:      iPhone9,4
Process:             <project_name> [19854]
Path:                /private/var/containers/Bundle/Application/76C36A05-8298-46F3-B3E7-99CC81BB7828/<project_name>.app/<project_name>
Identifier:          <bundle_id>
Version:             1610031500 (8.6)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           <bundle_id> [3765]


Date/Time:           2017-05-04 00:45:43.2490 +0200
Launch Time:         2017-05-04 00:45:43.0974 +0200
OS Version:          iPhone OS 10.3.1 (14E304)
Report Version:      104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001866d5bb8
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [0]
Triggered by Thread:  0

Application Specific Information:
BUG IN CLIENT OF LIBDISPATCH: trying to lock recursively

Filtered syslog:
None found

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:

CrashReporter Key:   89e10780ec2d7b94591ee6aa402d4449adcecfa1
Hardware Model:      iPhone9,4
Process:             <project_name> [19854]
Path:                /private/var/containers/Bundle/Application/76C36A05-8298-46F3-B3E7-99CC81BB7828/<project_name>.app/<project_name>
Identifier:          <project_name>
Version:             1610031500 (8.6)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           <project_name> [3765]


Date/Time:           2017-05-04 00:45:43.2490 +0200
Launch Time:         2017-05-04 00:45:43.0974 +0200
OS Version:          iPhone OS 10.3.1 (14E304)
Report Version:      104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001866d5bb8
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [0]
Triggered by Thread:  0

Application Specific Information:
BUG IN CLIENT OF LIBDISPATCH: trying to lock recursively

Filtered syslog:
None found

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libdispatch.dylib                 0x000000018a8b94e4 _dispatch_gate_wait_slow + 136
1   libdispatch.dylib                 0x000000018a8a6ff4 dispatch_once_f + 124
2   libdispatch.dylib                 0x000000018a8a6ff4 dispatch_once_f + 124
3   CoreGraphics                      0x000000018ce92110 CGFontCreate + 160
4   CoreGraphics                      0x000000018ce92718 CGFontCreateFontsWithPath + 104
5   CoreGraphics                      0x000000018cee47bc CGFontCreateFontsWithURL + 376
6   GraphicsServices                  0x000000018d3a1198 AddFontsFromURLOrPath + 124
7   GraphicsServices                  0x000000018d3a4790 __Initialize_block_invoke + 1048
8   libdispatch.dylib                 0x000000018a8a61bc _dispatch_client_callout + 16
9   libdispatch.dylib                 0x000000018a8a6fb0 dispatch_once_f + 56
10  GraphicsServices                  0x000000018d3a0898 Initialize + 272
11  libdispatch.dylib                 0x000000018a8a61bc _dispatch_client_callout + 16
12  libdispatch.dylib                 0x000000018a8a6fb0 dispatch_once_f + 56
13  CoreGraphics                      0x000000018ce92110 CGFontCreate + 160
14  CoreGraphics                      0x000000018ce92214 CGFontCreateWithDataProvider + 24
15  Tracker                           0x0000000104aef060 0x10496c000 + 1585248
16  Tracker                           0x0000000104aecccc 0x10496c000 + 1576140
17  Tracker                           0x0000000104aed120 0x10496c000 + 1577248
18  Tracker                           0x000000010499753c 0x10496c000 + 177468
19  Tracker                           0x0000000104997118 0x10496c000 + 176408
20  StatManager                       0x0000000103544070 0x103538000 + 49264
21  StatManager                       0x0000000103540924 0x103538000 + 35108
22  StatManager                       0x0000000103540600 0x103538000 + 34304
23  <project_name>                    0x000000010029e9e8 -[AppDelegate(Statistics) setupStatsKit] (AppDelegate+Statistics.m:32)

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.