Giter Club home page Giter Club logo

leanplum-ios-sdk's Issues

Storing __Leanplum.sqlite in Documents

The __Leanplum.sqlite database that is new as of 2.0.3 is currently stored in the app container's Documents directory, which is reserved for user specific data.

All other analytics providers, and generally any non-user data, is stored under the Library directory in the container.

Can this please be added to the fix list? I realize how pedantic this is, but we are hoping to enable a feature in a future release that uses iCloud Drive and shows that Documents directory for sharing info with us. Having the Leanplum file there is going to be confusing to our users.

test

Expected Behavior

Actual Behavior

Steps to Reproduce the Problem

Specifications

  • Version:
  • Platform:
  • Subsystem:

carthage not buid Leanplum-iOS-SDK

in Cartfile, i have
github "Leanplum/Leanplum-iOS-SDK" "1.7.0"

then i ran
carthage update --platform iOS --no-use-binaries

NO Leanplum build action is found and there's no output in the folder of /Carthage/Build/iOS

In-framework documentation

If I read the Leanplum headers in your bundled framework it shows a bit of documentation, but none of it is written in a way that will actually render in Xcode. Would be nice if I could get quick help for the public methods in the framework.

Are there static libraries contained within the LeanPlum framework?

We are getting a CocoaPods error when trying to enable Swift code in our private pod that has a dependency on the LeanPlum framework. This seems to point to Leanplum having internal static libraries, which cannot be used within a Swift enabled pod.

[!] The 'Pods-MyPrivatePod' target has transitive dependencies that include static binaries: (/myPath/Pods/Leanplum-iOS-SDK/Leanplum.framework)

crash when going into background

I'm seeing this crash from crashlytics when users are going into the background.
Leanplum SDK: 2.0.3
Xcode: 9.1
Frequency: ~20 crashes per day
Looks possibly to coincide with our upgrade to Xcode9.1

screen shot 2017-11-20 at 6 07 09 am

Core Location prompt on launch

V1.4 and newer automatically Asks location permission on setup, this means when our app is launched we get a prompt. We had deliberately deferred this prompt to improve both the onboarding and the likelihood that the users grants permissions since it's now in a location dependant area in the app.

However since updating to v1.4.x of leanplum, we are seeing location prompt on launch.

Please provide a hook to disable this behaviour. I want location for my users but I cannot accept an upfront request and I prefer to not have location for some users.

Migrate imports from PCH file to every file.

(Mozilla / Firefox)

When dropping the Leanplum source code directly in a project, the code does not compile unless we include a number of #import <Foundation/Foundation.h> and #import <UIKit/UIKit.h> statements.

See the attached diff.

This is a little odd, it seems the main culprit here is __IPHONE_OS_VERSION_MIN_REQUIRED being undefined. Why is that? Our project has the Minimal Deployment Target set to 9.3 - so I was expecting that to do the right thing for that check.

diff --git a/Leanplum-SDK/Classes/Constants.h b/Leanplum-SDK/Classes/Constants.h
index e1c6abe..0c09bfb 100644
--- a/Leanplum-SDK/Classes/Constants.h
+++ b/Leanplum-SDK/Classes/Constants.h
@@ -23,6 +23,7 @@
 //  under the License.

 #import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>

 #define IOS_6_SUPPORTED defined(_ARM_ARCH_7) || defined(__i386__) || defined(__LP64__)

diff --git a/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Categories/NSDate+RFC1123.m b/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Categories/NSDate+RFC1123.m
index e874a88..c17310e 100755
--- a/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Categories/NSDate+RFC1123.m
+++ b/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Categories/NSDate+RFC1123.m
@@ -6,6 +6,7 @@
 //  http://blog.mro.name/2009/08/nsdateformatter-http-header/
 //
 //  No obvious license attached
+#import <Foundation/Foundation.h>
 #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000

 #import "NSDate+RFC1123.h"
diff --git a/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Categories/NSDictionary+RequestEncoding.m b/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Categories/NSDictionary+RequestEncoding.m
index cc26e48..18c3735 100755
--- a/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Categories/NSDictionary+RequestEncoding.m
+++ b/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Categories/NSDictionary+RequestEncoding.m
@@ -22,6 +22,9 @@
 //  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.
+
+#import <Foundation/Foundation.h>
+
 #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000

 #import "MKNetworkKit.h"
diff --git a/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Categories/NSString+MKNetworkKitAdditions.m b/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Categories/NSString+MKNetworkKitAdditions.m
index f11b193..6ed66f0 100755
--- a/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Categories/NSString+MKNetworkKitAdditions.m
+++ b/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Categories/NSString+MKNetworkKitAdditions.m
@@ -22,6 +22,7 @@
 //  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.
+#import <Foundation/Foundation.h>
 #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000

 #import "NSString+MKNetworkKitAdditions.h"
diff --git a/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNKEngineWrapper.m b/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNKEngineWrapper.m
index 2b24be6..2f86b09 100644
--- a/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNKEngineWrapper.m
+++ b/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNKEngineWrapper.m
@@ -5,6 +5,7 @@
 //  Created by Alexis Oyama on 11/14/16.
 //  Copyright (c) 2016 Leanplum, Inc. All rights reserved.
 //
+#import <Foundation/Foundation.h>
 #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000

 #import "Leanplum_MKNKEngineWrapper.h"
diff --git a/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNKOperationWrapper.m b/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNKOperationWrapper.m
index 4e11bb8..14b10a1 100644
--- a/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNKOperationWrapper.m
+++ b/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNKOperationWrapper.m
@@ -5,6 +5,7 @@
 //  Created by Alexis Oyama on 11/14/16.
 //  Copyright (c) 2016 Leanplum, Inc. All rights reserved.
 //
+#import <Foundation/Foundation.h>
 #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000

 #import "Leanplum_MKNKOperationWrapper.h"
diff --git a/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNetworkEngine.m b/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNetworkEngine.m
index a35d86a..749dda2 100755
--- a/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNetworkEngine.m
+++ b/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNetworkEngine.m
@@ -22,6 +22,7 @@
 //  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.
+#import <Foundation/Foundation.h>
 #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000

 #import "MKNetworkKit.h"
diff --git a/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNetworkOperation.m b/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNetworkOperation.m
index f5b4e18..17a0e68 100755
--- a/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNetworkOperation.m
+++ b/Leanplum-SDK/Classes/Vendor/MKNetworkKit/Leanplum_MKNetworkOperation.m
@@ -22,6 +22,9 @@
 //  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.
+
+#import <Foundation/Foundation.h>
+
 #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000

 #import "MKNetworkKit.h"
diff --git a/Leanplum-SDK/Classes/Vendor/Reachability/Leanplum_Reachability.m b/Leanplum-SDK/Classes/Vendor/Reachability/Leanplum_Reachability.m
index 97559ba..0ac31c9 100755
--- a/Leanplum-SDK/Classes/Vendor/Reachability/Leanplum_Reachability.m
+++ b/Leanplum-SDK/Classes/Vendor/Reachability/Leanplum_Reachability.m
@@ -25,6 +25,7 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  POSSIBILITY OF SUCH DAMAGE.
  */

+#import <Foundation/Foundation.h>
 #import "Leanplum_Reachability.h"


diff --git a/Leanplum-SDK/Classes/Vendor/UniqueIdentifier/UIDevice+IdentifierAddition.m b/Leanplum-SDK/Classes/Vendor/UniqueIdentifier/UIDevice+IdentifierAddition.m
index 44612b7..12f769b 100755
--- a/Leanplum-SDK/Classes/Vendor/UniqueIdentifier/UIDevice+IdentifierAddition.m
+++ b/Leanplum-SDK/Classes/Vendor/UniqueIdentifier/UIDevice+IdentifierAddition.m
@@ -6,6 +6,9 @@
 //  Copyright 2011 Aurora Apps. All rights reserved.
 //

+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
 #import "UIDevice+IdentifierAddition.h"
 #import "NSString+MD5Addition.h"

Error building when using 2 Xcodes

Very frequently when I try to build the framework, I get the following failure. Simply running ./build.sh a couple more times eventually gets rid of it.

sarentz@Risa ~/P/Leanplum (develop)> ./build.sh
Analyzing dependencies
Fetching podspec for `Leanplum-iOS-SDK-source` from `../`
Downloading dependencies
Installing Leanplum-iOS-SDK-source (2.0.2)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
Starting dylib build for Leanplum-SDK (iOS)
Building Leanplum-SDK (device/armv7) target ...
ERROR [2017-09-06T21:01:14-0400]: Error running command: 'xcodebuild -configuration Release -target Leanplum-iOS-SDK-source-iOS -sdk iphoneos clean build ARCHS=armv7 RUN_CLANG_STATIC_ANALYZER=NO BUILD_DIR=/tmp/AppleSDK-build/build-armv7 BUILD_ROOT=/tmp/AppleSDK-build OTHER_CFLAGS=-fembed-bitcode GCC_PREPROCESSOR_DEFINITIONS=PACKAGE_IDENTIFIER=s':2017-09-06 21:01:10.769 xcodebuild[33954:17577666] CoreSimulator detected Xcode.app relocation or CoreSimulatorService version change.  Framework path (/Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework) and version (375.21) does not match existing job path (/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc) and version (494.13.4).  Attempting to remove the stale service in order to add the expected version.

I have both Xcode 8.3.3 and Xcode 9.0b6 installed, but the tools should point to the correct version:

sarentz@Risa ~/P/Leanplum (develop)> xcode-select -p
/Applications/Xcode.app/Contents/Developer

Is this a known issue. Is there a workaround?

This is a test!

Expected Behavior

Actual Behavior

Steps to Reproduce the Problem

Specifications

  • Version:
  • Platform:
  • Subsystem:

Bitcode Error On Archive

Hi,

Using the 1.7 SDK we are getting this error. Not sure if it's related to a change you all made or us bumping up to Xcode 8.3 (or both)?

ld: bitcode bundle could not be generated because '/Users/justin/Development/TEDapp/Carthage/Build/iOS/Leanplum.framework/Leanplum' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build for architecture arm64

debug console output w/ new leanplum sdk (1.4.0)

starting to get this w/ the latest sdk:
2016-09-08 05:37:26.126 Activehours[13877:219308] Leanplum: onData 2::
2016-09-08 05:37:26.126 Activehours[13877:219308] Leanplum: setTimeout()
2016-09-08 05:37:26.127 Activehours[13877:219308] Leanplum: heartbeat
2016-09-08 05:37:26.127 Activehours[13877:219308] Leanplum: send()
2016-09-08 05:37:26.127 Activehours[13877:219308] Leanplum: send() >>> 2::
2016-09-08 05:37:51.188 Activehours[13877:219308] Leanplum: onData 2::
2016-09-08 05:37:51.189 Activehours[13877:219308] Leanplum: setTimeout()
2016-09-08 05:37:51.189 Activehours[13877:219308] Leanplum: heartbeat
2016-09-08 05:37:51.190 Activehours[13877:219308] Leanplum: send()
2016-09-08 05:37:51.190 Activehours[13877:219308] Leanplum: send() >>> 2::
2016-09-08 05:38:16.252 Activehours[13877:219308] Leanplum: onData 2::
2016-09-08 05:38:16.252 Activehours[13877:219308] Leanplum: setTimeout()
2016-09-08 05:38:16.252 Activehours[13877:219308] Leanplum: heartbeat
2016-09-08 05:38:16.252 Activehours[13877:219308] Leanplum: send()
2016-09-08 05:38:16.253 Activehours[13877:219308] Leanplum: send() >>> 2::
2016-09-08 05:38:41.515 Activehours[13877:219308] Leanplum: onData 2::
2016-09-08 05:38:41.516 Activehours[13877:219308] Leanplum: setTimeout()
2016-09-08 05:38:41.516 Activehours[13877:219308] Leanplum: heartbeat
2016-09-08 05:38:41.517 Activehours[13877:219308] Leanplum: send()
2016-09-08 05:38:41.517 Activehours[13877:219308] Leanplum: send() >>> 2::
2016-09-08 05:39:06.706 Activehours[13877:219308] Leanplum: onData 2::
2016-09-08 05:39:06.706 Activehours[13877:219308] Leanplum: setTimeout()
2016-09-08 05:39:06.707 Activehours[13877:219308] Leanplum: heartbeat
2016-09-08 05:39:06.707 Activehours[13877:219308] Leanplum: send()
2016-09-08 05:39:06.707 Activehours[13877:219308] Leanplum: send() >>> 2::
2016-09-08 05:39:31.794 Activehours[13877:219308] Leanplum: onData 2::
2016-09-08 05:39:31.794 Activehours[13877:219308] Leanplum: setTimeout()
2016-09-08 05:39:31.795 Activehours[13877:219308] Leanplum: heartbeat
2016-09-08 05:39:31.795 Activehours[13877:219308] Leanplum: send()
2016-09-08 05:39:31.796 Activehours[13877:219308] Leanplum: send() >>> 2::

Nullability annotations

Surprised I didn't see it in the open list, but not having nullability annotations on the Leanplum SDK makes some fields a bit of a guessing game as to what is required vs optional when using it in Swift.

App Startup Crash in Leanplum: +[LPVarCache loadDiffs] + 968

This is currently in our top 3 of crashes. This is an urgent request to look at this crash since it happens at app startup time, about 10 seconds in. This is Leanplum 2.0.3 without any modifications.

The 2.0.4 release notes do not mention crashes, but maybe this look familiar?

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

Thread 1 name:
Thread 1 Crashed:
0   CoreFoundation                	0x0000000182683c68 _CFRelease + 628 (CFRuntime.c:1976)
1   Leanplum                      	0x000000010112a6d4 +[LPVarCache loadDiffs] + 968
2   Leanplum                      	0x000000010112a6d4 +[LPVarCache loadDiffs] + 968
3   Leanplum                      	0x00000001010e4038 __59+[Leanplum startWithUserId:userAttributes:responseHandler:]_block_invoke.680 + 92
4   Leanplum                      	0x000000010110309c __32-[LeanplumRequest sendRequests:]_block_invoke + 1428
5   Foundation                    	0x00000001830a5310 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16 (NSOperation.m:1467)
6   Foundation                    	0x0000000182fe59e4 -[NSBlockOperation main] + 72 (NSOperation.m:1486)
7   Foundation                    	0x0000000182fd5620 -[__NSOperationInternal _start:] + 848 (NSOperation.m:830)
8   Foundation                    	0x00000001830a7004 __NSOQSchedule_f + 404 (NSOperation.m:2081)
9   libdispatch.dylib             	0x000000018205d048 _dispatch_client_callout + 16 (object.m:502)
10  libdispatch.dylib             	0x0000000182099794 _dispatch_continuation_pop$VARIANT$armv81 + 420 (inline_internal.h:2500)
11  libdispatch.dylib             	0x0000000182098134 _dispatch_async_redirect_invoke$VARIANT$armv81 + 596 (queue.c:3429)
12  libdispatch.dylib             	0x000000018209e418 _dispatch_root_queue_drain + 564 (inline_internal.h:2539)
13  libdispatch.dylib             	0x000000018209e180 _dispatch_worker_thread3 + 112 (queue.c:6104)
14  libsystem_pthread.dylib       	0x0000000182303120 _pthread_wqthread + 1268 (pthread.c:2286)
15  libsystem_pthread.dylib       	0x0000000182302c20 start_wqthread + 4

Full crash report attached:

2017-11-26_17-28-16.6377_-0700-35fcf98486ef88ad7d10bb6945e1b625cd8069fb.txt

Build results in incorrect Leanplum.framework/Modules/module.modulemap

After building the framework, following the instructions in the README.md, the Release/Leanplum.framework/Modules/module.modulemap looks like this:

framework module Leanplum {
  umbrella header "Leanplum-iOS-SDK-source-iOS-umbrella.h"

  export *
  module * { export * }
}

This is incorrect, the umbrella header should point to "Leanplum.h" instead.

This is with Xcode 8.3.3 on MacOS 10.12.6.

Leanplum.onStartResponse called twice when Leanplum server is unreachable

We're seeing the Leanplum.onStartResponse block get called twice when the iOS device has a network connection, but LP is unreachable.

Environment:
Leanplum Framework version: 2.0.4
iOS SDK: 11
Xcode 9.2

Steps to Reproduce:

  1. Connect to a network
  2. Edit the network settings in the iOS Settings app > Wi-Fi > [Network Name] > (i) > Configure Proxy
  3. Set Proxy to "Manual"
  4. Set Server to an unused IP Address. (e.g. 10.0.0.1)
  5. Set break point inside the custom .onStartResponse block
  6. Make sure Leanplum.start() is called
  7. Debug app in Xcode and wait for callback to get called two times.

Unable to be used with Carthage

I'm running into the following issue when using Leanplum with Carthage:

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

It looks as though it's not being linked to StoreKit.

Build Error: lipo: -remove i386 specified but fat file: Leanplum does not contain that architecture

In the setup docs (in the dashboard) it says to add a run script to your project step "7. Strip framework script":

screen shot 2017-11-10 at 11 58 33 am

When I try and archive my project I get this error:

screen shot 2017-11-10 at 11 57 28 am

Same thing for x86_64 if I remove just -remove i386 from the run script:

screen shot 2017-11-10 at 12 01 55 pm

I installed Leanplum 2.0.3 using carthage. I'm running Swift 4.0.2 in Xcode 9.1 (9B55).

If I remove the run script completely, the archive works as expected... am I alright to leave that out though?

Unclear how to build the SDK from source

(Mozilla / Firefox)

It is unclear how to build the SDK from source code

  • The _Pods.xcodeproj does not build from Xcode
  • The master and develop branches have a build.sh script but it fails
  • The releases/2.0.1 branch has no build.sh

Can you please provide documentation or assistance on how to build the Leanplum.framework from the source code?

test

Expected Behavior

test

Actual Behavior

Steps to Reproduce the Problem

Specifications

  • Version:
  • Platform:
  • Subsystem:

didRegisterForPushNotification callback

Not sure if here is the best place for raising this but the documentation for push notifications doesn’t mention anything about the didRegisterForPushNotification callback and how to send an acquired device token to your server.

It turns out there’s a bit of swizzling magic happening in the background so the SDK seems to be taking care of it.

In this case I think it is at least worthwhile mentioning it and documenting the expected behaviour.

From my tests the framework captures that callback,
saved the token and then relays the message to the original app delegate method.

Is this correct?

Cheers
Rog

Crash [LPVarCache saveDiffs]

Possibly related to Issue #129

Steps to Reproduce the Problem

  1. Rare crash. Unable to reproduce, but reported via Crashlytics.

Specifications

  • Version: Leanplum SDK 2.0.5
  • Platform: iPhone iOS 11
com.apple.main-thread
0  libsystem_kernel.dylib         0x18fd3a398 stat + 8
1  libsqlite3.dylib               0x1912f062c (null) + 1996
2  libsqlite3.dylib               0x1912d380c (null) + 40748
3  libsqlite3.dylib               0x1912d7868 (null) + 57224
4  libsqlite3.dylib               0x1912d7250 (null) + 55664
5  libsqlite3.dylib               0x1912b3698 (null) + 20252
6  libsqlite3.dylib               0x1912ae9d4 sqlite3_step + 600
7  Leanplum                       0x100ceeddc -[LPDatabase runQuery:bindObjects:] + 104
8  Leanplum                       0x100cf0394 +[LPEventDataManager addEvent:] + 204
9  Leanplum                       0x100ce310c -[LeanplumRequest sendEventually] + 428
10 Leanplum                       0x100ce1a74 -[LeanplumRequest send] + 32
11 Leanplum                       0x100ccaab8 +[Leanplum setUserIdInternal:withAttributes:] + 520
12 Leanplum                       0x100cc5240 +[Leanplum onStartIssued:] + 108
13 Leanplum                       0x100cca7d8 +[Leanplum setUserId:withUserAttributes:] + 684
14 Leanplum                       0x100cca508 +[Leanplum setUserId:] + 112
15 --REDACTED--                   0x1003798ac specialized LeanplumAnalyticsDriver.(start(deviceId : String, onStart : () -> ()) -> ()).(closure #1) (LeanplumAnalyticsDriver.swift:42)
16 --REDACTED--                   0x1003796a8 partial apply for LeanplumAnalyticsDriver.(start(deviceId : String, onStart : () -> ()) -> ()).(closure #1) (LeanplumAnalyticsDriver.swift)
17 --REDACTED--                   0x1001972cc thunk (MainViewController.swift)
18 Leanplum                       0x100cbf62c +[Leanplum triggerStartResponse:] + 552
19 Leanplum                       0x100cc3644 __59+[Leanplum startWithUserId:userAttributes:responseHandler:]_block_invoke.680 + 112
20 Leanplum                       0x100cef4f0 -[LPEventCallback invokeError:] (LPEventCallbackManager.m:72)
21 Leanplum                       0x100cf013c +[LPEventCallbackManager invokeErrorCallbacksWithError:] (LPEventCallbackManager.m:170)
22 Leanplum                       0x100ce2c0c __32-[LeanplumRequest sendRequests:]_block_invoke.172 (LeanplumRequest.m:413)
23 Leanplum                       0x100d03d30 __39-[LPNetworkOperation runSynchronously:]_block_invoke_2 (LPNetworkOperation.m:179)
24 libdispatch.dylib              0x18fc11200 _dispatch_call_block_and_release + 24
25 libdispatch.dylib              0x18fc111c0 _dispatch_client_callout + 16
26 libdispatch.dylib              0x18fc15d6c _dispatch_main_queue_callback_4CF + 1000
27 CoreFoundation                 0x190d33f2c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
28 CoreFoundation                 0x190d31b18 __CFRunLoopRun + 1660
29 CoreFoundation                 0x190c60048 CFRunLoopRunSpecific + 444
30 GraphicsServices               0x1926e6198 GSEventRunModal + 180
31 UIKit                          0x196c4c2fc -[UIApplication _run] + 684
32 UIKit                          0x196c47034 UIApplicationMain + 208
33 --REDACTED--                   0x1000f5d90 main (AppDelegate.swift:27)
34 (Missing)                      0x18fc445b8 (Missing)
Thread #1
Crashed: NSOperationQueue 0x170036f00 :: NSOperation 0x1702502c0 (QOS: USER_INTERACTIVE)
0  libobjc.A.dylib                0x18f7d2f30 objc_msgSend + 16
1  Foundation                     0x1917ce8bc _encodeObject + 332
2  Leanplum                       0x100d0a630 +[LPVarCache saveDiffs] + 604
3  Leanplum                       0x100d0afec +[LPVarCache applyVariableDiffs:messages:updateRules:eventRules:variants:regions:] (LPVarCache.m:555)
4  Leanplum                       0x100d0a2cc +[LPVarCache loadDiffs] (LPVarCache.m:421)
5  Leanplum                       0x100cc3630 __59+[Leanplum startWithUserId:userAttributes:responseHandler:]_block_invoke.680 (Leanplum.m:1014)
6  Leanplum                       0x100ce26d4 __32-[LeanplumRequest sendRequests:]_block_invoke (LeanplumRequest.m:429)
7  Foundation                     0x19184a754 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
8  Foundation                     0x19178f2c8 -[NSBlockOperation main] + 96
9  Foundation                     0x19177f8c4 -[__NSOperationInternal _start:] + 620
10 Foundation                     0x19184cb00 __NSOQSchedule_f + 228
11 libdispatch.dylib              0x18fc111c0 _dispatch_client_callout + 16
12 libdispatch.dylib              0x18fc1f444 _dispatch_queue_serial_drain + 928
13 libdispatch.dylib              0x18fc149a8 _dispatch_queue_invoke + 652
14 libdispatch.dylib              0x18fc2138c _dispatch_root_queue_drain + 572
15 libdispatch.dylib              0x18fc210ec _dispatch_worker_thread3 + 124
16 libsystem_pthread.dylib        0x18fe1a2b8 _pthread_wqthread + 1288
17 libsystem_pthread.dylib        0x18fe19da4 start_wqthread + 4

Crash on 2.0.3

Hello, we got a Crashlytics report that our users are experiencing a crash in the Leanplum SDK 2.0.3, here is the stack trace they provided us with:

Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x18190c430 objc_msgSend + 16
1  CoreFoundation                 0x1822f6f68 -[NSArray isEqualToArray:] + 84
2  Leanplum                       0x100a833b4 +[LPVarCache applyVariableDiffs:messages:updateRules:eventRules:variants:regions:] + 1600
3  Leanplum                       0x100a3b798 __59+[Leanplum startWithUserId:userAttributes:responseHandler:]_block_invoke.606 + 464
4  Leanplum                       0x100a6854c __79+[LPEventCallbackManager invokeSuccessCallbacksOnResponses:requests:operation:]_block_invoke + 148
5  CoreFoundation                 0x1822b26cc -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 232
6  Leanplum                       0x100a6843c +[LPEventCallbackManager invokeSuccessCallbacksOnResponses:requests:operation:] + 876
7  Leanplum                       0x100a5b2f0 __32-[LeanplumRequest sendRequests:]_block_invoke_2 + 252
8  Leanplum                       0x100a7c308 __39-[LPNetworkOperation runSynchronously:]_block_invoke_2 + 424
9  libdispatch.dylib              0x181d69088 _dispatch_call_block_and_release + 24
10 libdispatch.dylib              0x181d69048 _dispatch_client_callout + 16
11 libdispatch.dylib              0x181d75b74 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1016
12 CoreFoundation                 0x18238bf20 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
13 CoreFoundation                 0x182389afc __CFRunLoopRun + 2012
14 CoreFoundation                 0x1822aa2d8 CFRunLoopRunSpecific + 436
15 GraphicsServices               0x18413bf84 GSEventRunModal + 100
16 UIKit                          0x18b857880 UIApplicationMain + 208
17 fla-ios                        0x100335a1c main (main.swift:14)
18 libdyld.dylib                  0x181dce56c start + 4

Device: 100% iPhone
OS: 100% iOS 11 (our users are a mixture of iOS 10, and 11, so this appears to be unique to 11)

Looks like the crash occurs in this method:

+ (void)applyVariableDiffs:(NSDictionary *)diffs_

something about comparing an array to another array.

Any ideas? Thanks

App Rejected w/ latest sdk: 1.4.0

Our app was recently rejected when we added the Leanplum 1.4.0 sdk in - it was rejected for the reason of having a private api: updateLayout

We reverted the sdk back to 1.3.12 and resubmitted to the store and were just approved.

Please provide a way to disable/stop the SDK

(Mozilla / Firefox)

Please provide a way to stop the disable/stop the SDK

The rationale for this change is as follows: in Firefox we have have a user setting called Send Anonymous Usage Data. When this option is disabled, Firefox will immediately stop sending Telemetry and will also disable another SDK that we use in the product. At that point nothing is tracked or sent to telemetry servers / services.

We will file a pull request as a starting point for this issue.

Crashes on dynamic variable in Swift

Hi, I am using it in Swift, it crashes when I tried to call.stringValue() function. My code is something like this:

static var kCancel= LPVar.define("CANCELLATION", withString:"test")

And when my code is tring to call kCancelBookingPopupTitleForTier1.stringValue(), it throws an exception, it seems only happened on string.

Message:

fatal error: unexpectedly found nil while unwrapping an Optional value

Xcode 9 Warnings

Seeing many warnings in Xcode 9 of type "This block declaration is not a prototype".
Can be easily fixed by Inserting 'void' inside ().

In files LPInbox.h, Leanplum.h, thanks.

No way to defer location permissions prompts

This issue only manifests when linking against one of the supplementary location/beacon libraries.

Correct me if I'm wrong, but it doesn't look like there's any supported way to tell Leanplum that it should never present a prompt asking for user's location. When linking against the location or beacon library, the app prompts the user on launch, which is annoying for users and greatly reduces overall opt-in (some light reading on the subject: http://techcrunch.com/2014/04/04/the-right-way-to-ask-users-for-ios-permissions/ ). Our app contains complex logic so that location permission prompts are shown at just the right time to maximize user opt-in, but Leanplum aggressively presents it as soon as [Leanplum start] is called.

For now, I'm swizzling CLLocationManager and NOPing all authorization requests made by Leanplum, but this is far from ideal.

iOS SDK 1.3.1 viewWillAppear not trigger

I have a tabBarController contain 5 tab,each tab is a navigationController,
viewControllers under navigation will not trigger viewWillAppear,
but it's work in 1.2.23, maybe not callback when using method swizzling.

The build.sh script hides compile errors

The build.sh script does something with redirection that makes compile errors disappear. I have to do the following to actually see why a compile fails:

diff --git a/build.sh b/build.sh
index 4199044..8839d1a 100755
--- a/build.sh
+++ b/build.sh
@@ -39,7 +39,7 @@ run() {

   set +o errexit
   local error
-  error=$(${cmd} 2>&1 >/dev/null)
+  error=$(${cmd})
   set -o errexit

   if [ -n "$error" ]; then

Is there a better way? Can I actually use Xcode to work on this framework? My current workflow is completely on the command line with emacs and ./build.sh. This works but it is not very convenient.

Historical messages are not retrieved

What I noticed in my testing on my iPhone is that when I login with an existing userId after delete the old app and reinstall ,the historical messages are not retrieved neither on StartLeanplum nor forceContentUpdate. I made sure these messages were not marked as read or deleted. It seems like a issue come from Leanplum backend.

Alert views presented on wrong view controller

Here is my situation:

  1. I have an alert configured in the leanplum messaging dashboard to appear when State "ViewController2" is triggered. I also set verbose debug logging and trackAllAppScreens as follows:
[Leanplum setVerboseLoggingInDevelopmentMode:YES];
[Leanplum trackAllAppScreens];
  1. In my app, I present ViewController2 with the following code:
UIStoryboard *SB = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
ViewController2 *vc2 = [SB instantiateViewControllerWithIdentifier:@"VC2"];
[self preventViewController2: vc2 animated:YES completion:nil];
  1. When I load ViewController2, I can see in the debug logs that Leanplum is attempting to display the alert I configured in step 1. However, the alert never appears, and I see this message in the xcode logs:
    Warning: Attempt to present <UIAlertController: 0x7fbffa67c180> on <ViewController: 0x7fbffa4536a0> whose view is not in the window hierarchy!

So, it seems like Leanplum is attempting to present the UIAlertView on the rootViewController, which is no longer visible, instead of the current view controller that is being displayed.

Additionally, if I change the message type from "Alert" to "Center popup" in Leanplum, then it appears as expected.

I'm happy to provide more information or a sample project if that would help.

Test

Expected Behavior

This is a test!

Actual Behavior

This is a test!

Steps to Reproduce the Problem

1.This is a test!
1.This is a test!
1.This is a test!

Specifications

This is a test!

  • Version:This is a test!
  • Platform:This is a test!
  • Subsystem:This is a test!

This is a test!

Xcode 7 Beta 3 + iOS 9 Beta 3

Im getting compile error when trying to run the app. It was working fine with 1.3.3. Im seeing this error after i update the version to 1.3.6 using cocopods.

Now i want go back to 1.3.3, but cocoa pods couldn't find the that version. Im receiving this error from pods "[!] Unable to find a specification for Leanplum-iOS-SDK1.3.3".

Compiler Error :
Ld /Users/ymedialabs/Library/Developer/Xcode/DerivedData/Tableaux-ebmgmudfgnxeywcrugwznpisqeaq/Build/Products/PreProd-iphoneos/Tableaux.app/Tableaux normal arm64
cd /Users/ymedialabs/Documents/Projects/Staples/iphone
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -L/Users/ymedialabs/Library/Developer/Xcode/DerivedData/Tableaux-ebmgmudfgnxeywcrugwznpisqeaq/Build/Products/PreProd-iphoneos -L/Users/ymedialabs/Documents/Projects/Staples/iphone/Pods/CardIO/CardIO -L/Users/ymedialabs/Documents/Projects/Staples/iphone/Pods/CrittercismSDK/CrittercismSDK -L/Users/ymedialabs/Documents/Projects/Staples/iphone/Tableaux/Library/Helpers/ThirdParty/AdobeMobileLibrary -L/Users/ymedialabs/Documents/Projects/Staples/iphone/Airship -F/Users/ymedialabs/Library/Developer/Xcode/DerivedData/Tableaux-ebmgmudfgnxeywcrugwznpisqeaq/Build/Products/PreProd-iphoneos -F/Users/ymedialabs/Documents/Projects/Staples/iphone/Pods/GoogleAppIndexing/Frameworks -F/Users/ymedialabs/Documents/Projects/Staples/iphone/Pods/Leanplum-iOS-SDK -F/Users/ymedialabs/Documents/Projects/Staples/iphone/Tableaux/Frameworks -filelist /Users/ymedialabs/Library/Developer/Xcode/DerivedData/Tableaux-ebmgmudfgnxeywcrugwznpisqeaq/Build/Intermediates/Tableaux.build/PreProd-iphoneos/Tableaux.build/Objects-normal/arm64/Tableaux.LinkFileList -miphoneos-version-min=8.0 -dead_strip -ObjC -lCardIO -lCrittercism_v5_2_0 -lPods-AFNetworkActivityLogger -lPods-AFNetworking -lPods-CocoaLumberjack -lPods-Lockbox -lPods-Mantle -lPods-UIAlertView+Blocks -lPods-apptentive-ios -lc++ -framework AVFoundation -framework Accelerate -framework AssetsLibrary -framework AudioToolbox -framework CFNetwork -framework CoreData -framework CoreGraphics -framework CoreMedia -framework CoreText -framework CoreVideo -framework Foundation -framework GoogleAppIndexing -framework Leanplum -framework MobileCoreServices -framework OpenGLES -framework QuartzCore -framework Security -framework SystemConfiguration -framework UIKit -weak_framework AdSupport -weak_framework CoreTelephony -weak_framework StoreKit -ObjC -lCardIO -lCrittercism_v5_2_0 -lPods-AFNetworkActivityLogger -lPods-AFNetworking -lPods-CocoaLumberjack -lPods-Lockbox -lPods-Mantle -lPods-UIAlertView+Blocks -lPods-apptentive-ios -lc++ -framework AVFoundation -framework Accelerate -framework AssetsLibrary -framework AudioToolbox -framework CFNetwork -framework CoreData -framework CoreGraphics -framework CoreMedia -framework CoreText -framework CoreVideo -framework Foundation -framework GoogleAppIndexing -framework Leanplum -framework MobileCoreServices -framework OpenGLES -framework QuartzCore -framework Security -framework SystemConfiguration -framework UIKit -weak_framework AdSupport -weak_framework CoreTelephony -weak_framework StoreKit -ObjC -lCardIO -lCrittercism_v5_2_0 -lPods-AFNetworkActivityLogger -lPods-AFNetworking -lPods-CocoaLumberjack -lPods-Lockbox -lPods-Mantle -lPods-UIAlertView+Blocks -lPods-apptentive-ios -lc++ -framework AVFoundation -framework Accelerate -framework AssetsLibrary -framework AudioToolbox -framework CFNetwork -framework CoreData -framework CoreGraphics -framework CoreMedia -framework CoreText -framework CoreVideo -framework Foundation -framework GoogleAppIndexing -framework Leanplum -framework MobileCoreServices -framework OpenGLES -framework QuartzCore -framework Security -framework SystemConfiguration -framework UIKit -weak_framework AdSupport -weak_framework CoreTelephony -weak_framework StoreKit -fobjc-arc -fobjc-arc -fobjc-link-runtime -liconv -lc++ -framework OpenGLES -framework PassKit -framework CoreVideo -framework CoreImage -lUAirship-5.1.1 -framework MapKit -framework MessageUI -framework CoreTelephony -framework Accelerate -framework QuartzCore -licucore -lsqlite3 -lz -framework Security -framework CFNetwork -lPods /Users/ymedialabs/Documents/Projects/Staples/iphone/Tableaux/Library/Helpers/ThirdParty/AdobeMobileLibrary/AdobeMobileLibrary.a -framework MobileCoreServices -framework CoreMedia -framework AudioToolbox -framework AVFoundation -framework SystemConfiguration -framework CoreLocation -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/ymedialabs/Library/Developer/Xcode/DerivedData/Tableaux-ebmgmudfgnxeywcrugwznpisqeaq/Build/Intermediates/Tableaux.build/PreProd-iphoneos/Tableaux.build/Objects-normal/arm64/Tableaux_dependency_info.dat -o /Users/ymedialabs/Library/Developer/Xcode/DerivedData/Tableaux-ebmgmudfgnxeywcrugwznpisqeaq/Build/Products/PreProd-iphoneos/Tableaux.app/Tableaux

ld: warning: ignoring file /Users/ymedialabs/Documents/Projects/Staples/iphone/Pods/Leanplum-iOS-SDK/Leanplum.framework/Leanplum, file was built for unsupported file format ( 0x2F 0x2F 0x0A 0x2F 0x2F 0x20 0x20 0x4C 0x65 0x61 0x6E 0x70 0x6C 0x75 0x6D 0x2E ) which is not the architecture being linked (arm64): /Users/ymedialabs/Documents/Projects/Staples/iphone/Pods/Leanplum-iOS-SDK/Leanplum.framework/Leanplum
Undefined symbols for architecture arm64:
"OBJC_CLASS$_Leanplum", referenced from:
objc-class-ref in SCTagHelper.o
objc-class-ref in STLibraryService.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

GenerateDSYMFile /Users/ymedialabs/Library/Developer/Xcode/DerivedData/Tableaux-ebmgmudfgnxeywcrugwznpisqeaq/Build/Products/PreProd-iphoneos/Tableaux.app.dSYM /Users/ymedialabs/Library/Developer/Xcode/DerivedData/Tableaux-ebmgmudfgnxeywcrugwznpisqeaq/Build/Products/PreProd-iphoneos/Tableaux.app/Tableaux
cd /Users/ymedialabs/Documents/Projects/Staples/iphone
export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/ymedialabs/Library/Developer/Xcode/DerivedData/Tableaux-ebmgmudfgnxeywcrugwznpisqeaq/Build/Products/PreProd-iphoneos/Tableaux.app/Tableaux -o /Users/ymedialabs/Library/Developer/Xcode/DerivedData/Tableaux-ebmgmudfgnxeywcrugwznpisqeaq/Build/Products/PreProd-iphoneos/Tableaux.app.dSYM

error: cannot parse the debug map for "/Users/ymedialabs/Library/Developer/Xcode/DerivedData/Tableaux-ebmgmudfgnxeywcrugwznpisqeaq/Build/Products/PreProd-iphoneos/Tableaux.app/Tableaux": No such file or directory

Carthage build fails on latest release (2.0.2)

When trying to update to the latest release, after running

carthage update Leanplum-iOS-SDK

The build fails with the following error message:

*** Skipped installing Leanplum-iOS-SDK.framework binary due to the error:                                                                                     │@@ -7,3 +7,10 @@
        "Failed to read file or folder at /private/var/folders/v9/b69j6j112xjbggkzm4xpkm3h0000gn/T/carthage-archive.ghwvVH/__MACOSX/Leanplum.framework: Error D│ //
omain=com.antitypical.Result Code=0 "the DTSDKName key in its plist file is missing" UserInfo={com.antitypical.Result.file=/tmp/carthage-20170710-56241-9g56uj/│ 
Source/CarthageKit/Project.swift, com.antitypical.Result.function=readFailed, com.antitypical.Result.line=1100, NSLocalizedDescription=the DTSDKName key in its│ import Foundation
 plist file is missing}"                                                                                                                                       │+
*** Checking out Leanplum-iOS-SDK at "2.0.2"                                                                                                                   │+class Leanplum {
*** xcodebuild output can be found in /var/folders/v9/b69j6j112xjbggkzm4xpkm3h0000gn/T/carthage-xcodebuild.x4OSkr.log                                          │+
*** Skipped building Leanplum-iOS-SDK due to the error:                                                                                                        │+  static func bootstrap() {
Dependency "Leanplum-iOS-SDK" has no shared framework schemes                                                                                                  │+  }

Version 2.0.1 and below works as expected.

Cheers,

Rog

This is a test!

Expected Behavior

Actual Behavior

Steps to Reproduce the Problem

Specifications

  • Version:
  • Platform:
  • Subsystem:

Library not loaded error after updating to 1.4.0

After upgrading (via cocopoads) to the 1.4.0 version, I get the following error in xcode when my app launches:

dyld: Library not loaded: @rpath/Leanplum.framework/Leanplum Referenced from: /var/containers/Bundle/Application/9FCD1F4A-F251-4C75-91E5-38EFB9115CE5/shoptiques.app/shoptiques Reason: image not found

I upgraded by running the following command:
pod update Leanplum-iOS-SDK

[Leanplum syncResourcesAsync:YES] - Causes UI to freeze

It appears this method, [Leanplum syncResourcesAsync:YES], is not truly Asynchronous.
When I have this method in place, and load my app, I discovered the UI freezes for a couple of seconds while LeanPlum is making some sort of connection/request.

To Repro:

  1. Launch app with above method in place.
  2. Interact with UI for a few seconds (Dragging up and down a TableView is a good example)
  3. Notice that the UI freezes for a couple seconds, then unfreezes.
  4. Remove [Leanplum syncResourcesAsync:YES], then relaunch app and repeat UI interactions.
  5. Notice no UI freeze.

LPVar with default BOOL value issue

Hi guys,

Not sure if I'm doing something wrong but if I setup a LPVar with a default Boolean value:

fileprivate var lpVarForTrueOrFalse = LPVar.define("lpVarForTrueOrFalse", with: true)

...and then observe for value changes with the callback below, when the call fails for whatever reason (i.e. no internet), the callback is called immediately but there is no indication that it failed and when I inspect the LPVar value it returns false when it should actually be nil.

lpVarForTrueOrFalse?.onValueChanged { [weak self] in
    print(lpVarForTrueOrFalse?.boolValue()) // Returns false instead of nil    
}

I think I understand why this happens as the SDK is built in Objective-C, but perhaps it might be a good idea to provide an API where the callback also includes a success flag?

lpVarForTrueOrFalse?.onValueChanged { [weak self] success in
    if success == false {  // LPVar was not updated for whatever reason
        print(lpVarForTrueOrFalse?.defaultValue()
    } else {
        print(lpVarForTrueOrFalse?.boolValue())
    }
}

This is so we can check and choose to use our fallback default value if the call to get update values from Leanplum has failed.

At the moment I have no way of knowing that this happened and since boolValue() always returns a value I have no way of knowing whether that's what the server returned or if it's because we haven't been able to fetch the values.

An easy workaround for now is to work with strings since stringValue() will return nil if the call to Leanplum fails.

Hope that all makes sense but let me know if you need need any more info?
Cheers,
Rog

Crash in [LPVarCache saveDiffs]

Steps to Reproduce the Problem

  1. Unknown. This is an infrequent crash reported to Crashlytics that we have not been able to reproduce.

Specifications

  • Version: LP SDK 2.0.5 2.0.4
  • Platform: iPhone, iOS 11
com.apple.main-thread
0  libsystem_kernel.dylib         0x1857b5734 guarded_pwrite_np + 8
1  libsqlite3.dylib               0x186141b00 sqlite3_rekey + 2476
2  libsqlite3.dylib               0x1861045bc sqlite3_free_table + 58480
3  libsqlite3.dylib               0x18614b788 sqlite3_rekey + 42548
4  libsqlite3.dylib               0x1860ffd30 sqlite3_free_table + 39908
5  libsqlite3.dylib               0x186103878 sqlite3_free_table + 55084
6  libsqlite3.dylib               0x186103220 sqlite3_free_table + 53460
7  libsqlite3.dylib               0x1860e0048 sqlite3_step + 21248
8  libsqlite3.dylib               0x1860db7dc sqlite3_step + 2708
9  Leanplum                       0x1018baddc -[LPDatabase runQuery:bindObjects:] + 104
10 Leanplum                       0x1018bc394 +[LPEventDataManager addEvent:] + 204
11 Leanplum                       0x1018af10c -[LeanplumRequest sendEventually] + 428
12 Leanplum                       0x1018ada74 -[LeanplumRequest send] + 32
13 Leanplum                       0x101896ab8 +[Leanplum setUserIdInternal:withAttributes:] + 520
14 Leanplum                       0x101891240 +[Leanplum onStartIssued:] + 108
15 Leanplum                       0x1018967d8 +[Leanplum setUserId:withUserAttributes:] + 684
16 Leanplum                       0x101896508 +[Leanplum setUserId:] + 112
17 --REDACTED--                   0x100efd8ac specialized LeanplumAnalyticsDriver.(start(deviceId : String, onStart : () -> ()) -> ()).(closure #1) (LeanplumAnalyticsDriver.swift:42)
18 --REDACTED--                   0x100efd6a8 partial apply for LeanplumAnalyticsDriver.(start(deviceId : String, onStart : () -> ()) -> ()).(closure #1) (LeanplumAnalyticsDriver.swift)
19 --REDACTED--                   0x100d1b2cc thunk (MainViewController.swift)
20 Leanplum                       0x10188b62c +[Leanplum triggerStartResponse:] + 552
21 Leanplum                       0x10188f644 __59+[Leanplum startWithUserId:userAttributes:responseHandler:]_block_invoke.680 + 112
22 Leanplum                       0x1018bb4f0 -[LPEventCallback invokeError:] + 136
23 Leanplum                       0x1018bc13c +[LPEventCallbackManager invokeErrorCallbacksWithError:] + 232
24 Leanplum                       0x1018aec0c __32-[LeanplumRequest sendRequests:]_block_invoke.172 + 284
25 Leanplum                       0x1018cfd30 __39-[LPNetworkOperation runSynchronously:]_block_invoke_2 + 176
26 libdispatch.dylib              0x18561ea54 _dispatch_call_block_and_release + 24
27 libdispatch.dylib              0x18561ea14 _dispatch_client_callout + 16
28 libdispatch.dylib              0x18562b698 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1016
29 CoreFoundation                 0x185c47344 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
30 CoreFoundation                 0x185c44f20 __CFRunLoopRun + 2012
31 CoreFoundation                 0x185b64c58 CFRunLoopRunSpecific + 436
32 GraphicsServices               0x187a10f84 GSEventRunModal + 100
33 UIKit                          0x18f2bd5c4 UIApplicationMain + 236
34 --REDACTED--                   0x100c79d90 main (AppDelegate.swift:27)
35 libdyld.dylib                  0x18568456c start + 4
Thread #2
Crashed: NSOperationQueue 0x1c4032620 (QOS: UNSPECIFIED)
0  libobjc.A.dylib                0x184efc430 objc_msgSend + 16
1  Foundation                     0x1865f30f0 _encodeObject + 208
2  Leanplum                       0x1018d6650 +[LPVarCache saveDiffs] + 636
3  Leanplum                       0x1018d6fec +[LPVarCache applyVariableDiffs:messages:updateRules:eventRules:variants:regions:] + 1828
4  Leanplum                       0x1018d62cc +[LPVarCache loadDiffs] + 1132
5  Leanplum                       0x10188f630 __59+[Leanplum startWithUserId:userAttributes:responseHandler:]_block_invoke.680 + 92
6  Leanplum                       0x1018ae6d4 __32-[LeanplumRequest sendRequests:]_block_invoke + 1424
7  Foundation                     0x186675ba0 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
8  Foundation                     0x1865b5894 -[NSBlockOperation main] + 72
9  Foundation                     0x1865a54c4 -[__NSOperationInternal _start:] + 848
10 Foundation                     0x186677894 __NSOQSchedule_f + 404
11 libdispatch.dylib              0x18561ea14 _dispatch_client_callout + 16
12 libdispatch.dylib              0x185626f08 _dispatch_continuation_pop$VARIANT$mp + 428
13 libdispatch.dylib              0x18562580c _dispatch_async_redirect_invoke$VARIANT$mp + 604
14 libdispatch.dylib              0x18562bcf4 _dispatch_root_queue_drain + 600
15 libdispatch.dylib              0x18562ba38 _dispatch_worker_thread3 + 120
16 libsystem_pthread.dylib        0x1858c706c _pthread_wqthread + 1268
17 libsystem_pthread.dylib        0x1858c6b6c start_wqthread + 4

Carthage Binary Specification

Hi,

Carthage added support for a new binary specification format in a recent release that I believe would make everyone's lives easier (at last those of us who are unable to use Pods).

On your end I believe it would just require you to update a JSON file either in this GitHub repo with a new new line for each release pointing to the zip file of the binary download.

I have an example of a Leanplum spec file on my fork: https://github.com/justin/Leanplum-iOS-SDK/blob/feature/carthage-spec/Leanplum-iOS-SDK.json

The benefit for us as consumers of your framework that we can specify in our Cartfile that we are wanting to fetch a binary framework, thus running carthage update or carthage bootstrap with a specific Swift toolchain won't fail because it doesn't know how to build Leanplum.

Example:

binary "https://raw.githubusercontent.com/justin/Leanplum-iOS-SDK/feature/carthage-spec/Leanplum-iOS-SDK.json" ~> 2.0.

It'd be great if you all could consider and implement this on your end. Thanks!

Xcode 8.3.1, Cocoapods 1.2.1 doesn't generate the Leanplum framework.

Hi,
I'm having an issue integrating Leanplum using Cocoapods.
I have another project that doesn't use framework and it generates just fine.
Running pod install, it doesn't add the Leanplum framework as expected.

Below is my Podfile:

platform :ios, '9.3'
source 'https://github.com/CocoaPods/Specs.git'

# ignore all warnings from all pods
inhibit_all_warnings!

target 'MyApp' do
  use_frameworks!
  pod 'Leanplum-iOS-SDK'
end

Am I missing anything? 🤔
Any help would be greatly appreciated!

Update Setup Documentation for Swift 4.0.2

Not sure this is exactly the right place for this issue, but wasn't sure where else was best to send it...

Your docs both in the account dashboard and here are not up to date with Swift 4.0.2. I was following the setup steps in the account dashboard.

In step 5 "Copy the highlighted statements into your AppDelegate.swift", the imports only include:

#if DEBUG
        import AdSupport
#endif

but I was getting errors like:

screen shot 2017-11-10 at 12 10 42 pm

In order to fix those, I had to add:

import Leanplum

to the top of my file. Similarly, anywhere I was using Leanplum.track() I needed to include import Leanplum.

Also, in step 5, the docs include the following in it's sample snippet to copy/paste:

Leanplum.setDeviceId(ASIdentifierManager.sharedManager().advertisingIdentifier.UUIDString)

But I was getting this error:

screen shot 2017-11-10 at 12 12 23 pm

To fix it, I had to change that line to:

Leanplum.setDeviceId(ASIdentifierManager.shared().advertisingIdentifier.uuidString)

I was also running into some issues with Step 7 of the docs in the account dashboard. See #100 for more details.

Are these all valid issues / changes? Or did I do something wrong in my setup? I installed Leanplum 2.0.3 using carthage and am running Swift 4.0.2 in Xcode 9.1 (9B55).

SQLite errors on tvOS

Expected Behavior

I'm having some issues with leanplum for tvOS I keep getting an error where we are unable to speak to what looks like a sqlite db. #109

I noticed you guys actually changed the location of this sqlite to Documents and I believe on tvOS you cant write to the documents it might have to be the library path. Below is the console log of errors I am receiving when trying to run on tvOS.

Actual Behavior

When attempting to start the leanplum sdk I receive these errors -

Leanplum ERROR: SQLite fail to prepare: 'SELECT count(*) FROM event;' unable to open database file (21)

Leanplum ERROR: SQLite fail to prepare: 'INSERT INTO event (data) VALUES (?);' unable to open database file (21)

Leanplum ERROR: SQLite fail to prepare: 'SELECT data FROM event ORDER BY rowid LIMIT 10000' 
Leanplum ERROR: SQLite fail to prepare: 'SELECT count(*) FROM event;' unable to open database file (21)

Leanplum ERROR: SQLite fail to prepare: 'INSERT INTO event (data) VALUES (?);' unable to open database file (21)```

## Steps to Reproduce the Problem

  1. Download the sample tvos sdk v2.0.5
  2. Add in keys
  3. Run from Xcode

## Specifications

  - Version: 2.0.5
  - Platform: tvOS 11.2.1

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.