Giter Site home page Giter Site logo

iterable / swift-sdk Goto Github PK

View Code? Open in Web Editor NEW
85.0 31.0 65.0 10.82 MB

Iterable's iOS SDK. Receive and track pushes to Iterable from your iOS app.

Home Page: https://iterable.com/

License: MIT License

Objective-C 1.54% Swift 97.51% Ruby 0.42% Shell 0.53%
sdk swift deep-links notifications inbox-customization ios ios-swift

swift-sdk's Introduction

Iterable logo

License Build Status codecov pod Carthage compatible

Iterable's iOS SDK

Iterable is a growth marketing platform that helps you to create better experiences for—and deeper relationships with—your customers. Use it to send customized email, SMS, push notification, in-app message, web push notification campaigns to your customers.

This SDK helps you integrate your iOS apps with Iterable.

Supported iOS versions

Iterable's iOS SDK supports iOS 10 and higher.

Installation

For installation instructions, read Iterable's iOS SDK.

Features

To learn more about various SDK features, read:

Sample projects

For sample code, take a look at the following projects:

Release notes, support and troubleshooting

Release notes:

Support policies:

Troubleshooting:

Questions? Talk to your customer success manager.

License

This SDK is released under the MIT License. For more information, see LICENSE.

Want to contribute?

This library is open source, and we will look at issue reports and pull requests. See CONTRIBUTING for more information.

swift-sdk's People

Contributors

amanforindia avatar anlinguist avatar ayyanchira avatar bradumbaugh avatar christinaschell avatar chunkyguy avatar cranberyxl avatar davidtruong avatar devcsomnicg avatar evantk91 avatar gbrixey avatar hani-iterable avatar hardikmashru avatar hardikmashruomnicg avatar jena-chakour avatar jyu115 avatar mprew97 avatar roninopf avatar tapashmajumder avatar vbabenkoru avatar volkanbicer 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

swift-sdk's Issues

v6.0.6 fails to build with latest XCode v10.2 (10E125)

I updated to the latest XCode release version 10.2 (10E125) today, and we're getting some build errors from the Iterable-iOS-SDK pod (v6.0.6) now when we build our project. Can you get out a new release that fixes these errors?

It looks like the compiler is flagging the typedefs created in the IterableConstants.h file. Since one of those has the _Nullable type applied to it, it expects that all of the other typedefs in that file have either _Nullable or _Nonnull applied to them. So to fix this, we just modified line 24 to remove the use of _Nullable:

typedef void (^OnFailureHandler)(NSString *reason, NSData * data);

Of course the other fix would be to apply _Nullable or _Nonnull correctly in that file on all the typedefs, but I'll leave that to you to determine how you want to fix it.

Carthage support

When I tried to download sdk via carthage, project itself failed to compile.

** ARCHIVE FAILED **


The following build commands failed:
	CompileSwift normal armv7
	CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler
	CompileSwift normal arm64
	CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(4 failures)

Data to hex conversion not working as expected

`public extension Data {
//from: https://stackoverflow.com/questions/39075043/how-to-convert-data-to-hex-string-in-swift
func hexString() -> String {
let digits = Array("01234567890abcdef".utf16)

    var chars: [UniChar] = []
    chars.reserveCapacity(count * 2)

    for byte in self {
        chars.append(digits[Int(byte / 16)])
        chars.append(digits[Int(byte % 16)])
    }

    return String(utf16CodeUnits: chars, count: chars.count)
}

}`

This code was added but doesn't work as expected. We are printing the hex bits before sending them to the iterable SDK and the values are not the same. Our method for printing the hex bits is below and when we use that value in place of the implementation above, our device tokens in iterable work with APNS and we actually receive push notifications.

let token = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()

Iteratable Static framework

Is there any way to get static framework of Iteratable instead of dynamic.
My purpose is to create a static library including iteratable framework.
I could not able to use iteratable dynamic framewok. So please share the static framework

Internal class leakage

There are quite a few areas inside of /swift-sdk/internal/ that leak into the public namespace. This causes naming conflicts when iterable is included with a project. One of the biggest and most common (as I can see) is the leak of Promise. These should probably be declared internal, or taken out of the internal directory and documented (though I feel this SDK should not provide tools such as these since it's not the focus of this SDK). Here's a list of files that have public declarations inside of the internal directory.

Promise.swift
Dwifft+UIKit.swift
IterableInboxImpression.swift
DateProvider.swift
AbstractDiffCalculator.swift
IterableActionRunner.swift
IterableUtil.swift

Carthage cannot build version 6.0.7 on Xcode 10.2

Carthage cannot build the latest version of the Iterable framework due to an archiving issue. Here is the Carthage log:

/usr/bin/xcrun xcodebuild -workspace /Users/gbrixey/Code/iOS/Carthage/Checkouts/swift-sdk/swift-sdk.xcworkspace -scheme ios9-tests -configuration Release -derivedDataPath /Users/gbrixey/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/swift-sdk/6.0.7 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/2c/hns7b5pj0szcl4sb4dpsddym0000gp/T/swift-sdk SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/gbrixey/Code/iOS/Carthage/Checkouts/swift-sdk)User defaults from command line:
    IDEArchivePathOverride = /var/folders/2c/hns7b5pj0szcl4sb4dpsddym0000gp/T/swift-sdk
    IDEDerivedDataPathOverride = /Users/gbrixey/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/swift-sdk/6.0.7

Build settings from command line:
    CARTHAGE = YES
    CLANG_ENABLE_CODE_COVERAGE = NO
    CODE_SIGN_IDENTITY = 
    CODE_SIGNING_REQUIRED = NO
    GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
    ONLY_ACTIVE_ARCH = NO
    SDKROOT = iphoneos12.2
    SKIP_INSTALL = YES
    STRIP_INSTALLED_PRODUCT = NO

note: Using new build system
note: Planning build
note: Constructing build description
Build system information
error: An empty identity is not valid when signing a binary for the product type 'Application'. (in target 'host-app')

** ARCHIVE FAILED **

Perhaps the host-app target should not be part of the Archive step for the swift-sdk scheme.

Unhandled Info.plist files in SPM

We have recently updated our project from using Carthage to using SPM for managing our dependencies.

We started with the Iterable SDK at version 6.2.10, because that's what we used under Carthage. Today, we updated to 6.2.13 and we got the following warning, under Resolve Package Graph:

⚠️  found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
[DerivedDataRedacted]/SourcePackages/checkouts/swift-sdk/notification-extension/Info.plist
⚠️ found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
[DerivedDataRedacted]/SourcePackages/checkouts/swift-sdk/swift-sdk/Info.plist

I went back and checked each version between 6.2.10 and 6.2.13 inclusive and it appears that this was introduced with 6.2.12.

We like to run a zero-warning project if at all possible. What steps can I take on my side to resolve these warnings, outside of downgrading back to 6.2.11?

How to resolve URL

Previously our app was able to use
ITEActionBlock to get a resolved value of the useractivity's URL and pass it to getAndTrackDeeplink for a custom action. This is now deprecated and would break our setup. Is there a way to just retrieve the resolved value when we receive the url inside of app delegate's
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler?

Thanks.

Use of NoneLogDelegate

I am trying to understand how I can use NoneLogDelegate, so that I can turn Iterable logging off as appropraite. When in my AppDelegate I write

let iterableConfig = IterableConfig()
iterableConfig.logDelegate = NoneLogDelegate()

I get the error

'NoneLogDelegate' initializer is inaccessible due to 'internal' protection level

Is there a different way of initializing an IterableConfig object with a NoneLogDelegate to avoid this issue?

Warning: Could not find IterableDataModel.momd in bundle

Hi Iterable team,

I am working to update Iterable iOS SDK version to Swift project, At version 6.3.4, I encounter 2 warnings.
Could you help to resolve them?

2021-10-24 12:37:36.302653+0700 TiffsTreats[70452:6048708] ❤️ 12:37:36.3020:0x283194800:IterableCoreDataPersistence:createManagedObjectModel(fromBundle:):64: Could not find IterableDataModel.momd in bundle
2021-10-24 12:37:36.302883+0700 TiffsTreats[70452:6048708] ❤️ 12:37:36.3030:0x283194800:IterableCoreDataPersistence:create(fromBundle:):44: Could not initialize managed object model

Our swift project uses Cocoapods.

Mobile Inbox - In App message presentation style

Hi, I'm working on Mobile Inbox feature for our app. I have issue with presentation style when user selects a message in the inbox. Can you make setModalPresentationStyle(for viewController: UIViewController) in IterableInboxViewController public or provide a way how to change the presentation style? I need to use .overCurrentContext value

Track is not working with the latest release 6.1.0

The track is not working with the latest SDK 6.1.0: i keep getting failure

sample Log:

2019-06-18 18:06:19.394765+0200 APP[328:11959] 💛 18:06:19.3940:IterableAppIntegration:userNotificationCenter(_:didReceive:withCompletionHandler:):39
2019-06-18 18:06:19.396186+0200 APP[328:11959] 💛 18:06:19.3950:IterableAppIntegrationInternal:userNotificationCenter(_:didReceive:withCompletionHandler:):166
2019-06-18 18:06:19.759885+0200 APP[328:12301] ❤️ 18:06:19.7580:IterableAPIInternal:defaultOnFailure(identifier:):611: trackPushOpen failed:, The operation couldn’t be completed. Software caused connection abort

Development Environment :

Xcode 10.2 -> iOS 12.3.x, iOS 11.2.x

Manual integration not working

I've followed the manual installation instructions https://github.com/Iterable/swift-sdk#manual-installation).

The project compiles but when trying to run it in the simulator I get:

dyld: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /Users/pedro/Library/Developer/CoreSimulator/Devices/B1720EDD-39FC-44D2-BDD7-61B2E9DE83F1/data/Containers/Bundle/Application/DA302F26-73DA-46D6-810E-C29E92AE862F/Chess.app/Frameworks/IterableSDK.framework/IterableSDK
  Reason: no suitable image found.  Did find:
	/usr/lib/swift/libswiftCore.dylib: mach-o, but not built for iOS simulator

The instructions only state two things:

  1. Add framework to "embedded binaries" section.
  2. Set "Always Embed Swift Standard Libraries" to Yes

What am I missing? I tested with the framework found in IterableSDK.zip v6.0.8.

'shared' is unavailable in application extensions for iOS

Attempting to use Iterable using a Sub-project (We have a main app, then a "Networking" app), however, when attempting to use Iterable, end up with the error
'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.

Was hoping for a fix

Could not find module 'IterableAppExtensions' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator

When running on a physical device, all works fine.
But when trying to run on simulator using M1 Apple Silicon processor and getting an error:
Could not find module 'IterableAppExtensions' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator

Xcode 12.5.1

Side note: my colleague runs on the same Xcode but with Intel processor and it works fine on the simulator.

LogLevel name conflict with other SDK

Hello,

It could be possible to change the name of the class LogLevel since we have a conflict with another class in other SDK, we noticed that Google Analytics has defined their log level class as GAILogLevel so I wonder if you could do something similar, since we added Iterable SDK we have this conflict with another SDK from Nordic Semiconductor which we have been using since last year, we just added Iterable SDK to our project so it would be great if you could add that change, we will appreciate.

Warnings in SDK

Hello-
For a few versions now, there have been these warnings in the Iterable SDK. If you'd like I can attempt to fix them and create a PR for you, but I thought I would raise the issue here first in case it's already being addressed in an upcoming version. Thank you.

Screen Shot 2020-10-30 at 10 07 20 AM

Screen Shot 2020-10-30 at 10 08 03 AM

bad URL for requests made by IterableSDK

Hello, I've gone through the iOS integration guide a few times, and I'm still getting bad URL errors for every request that the InterableSDK sends.

Details:

  1. Installed via CocoaPods.
  2. Version 6.4.1.
  3. iOS app supporting 13+.

Here's what I see in the console in Xcode when filtering for "iterable" (some specifics replaced with generic strings):

2022-01-27 15:08:02.245900-0600 ApplicationName[1423:162685] 💛 15:08:02.2450:0x280a64840:InternalIterableAPI:init(apiKey:launchOptions:config:apiEndPointOverride:dependencyContainer:):521
2022-01-27 15:08:02.246370-0600 ApplicationName[1423:162685] 💛 15:08:02.2460:0x280a64840:InternalIterableAPI:start():537
2022-01-27 15:08:02.248341-0600 ApplicationName[1423:162685] ❤️ 15:08:02.2480:0x280a64840:IterableCoreDataPersistence:createManagedObjectModel(fromBundle:):63: Could not find IterableDataModel.momd in bundle
2022-01-27 15:08:02.248623-0600 ApplicationName[1423:162685] ❤️ 15:08:02.2480:0x280a64840:IterableCoreDataPersistence:create(fromBundle:):43: Could not initialize managed object model
2022-01-27 15:08:02.250546-0600 ApplicationName[1423:162685] 💛 15:08:02.2500:0x280a64840:InternalIterableAPI:checkRemoteConfiguration():617
2022-01-27 15:08:02.255050-0600 ApplicationName[1423:162685] 💛 15:08:02.2550:0x280a64840:InternalIterableAPI:setEmail(_:):99
), NSLocalizedDescription=bad URL, NSErrorFailingURLStringKey=https://api.iterable.com/api/mobile/getRemoteConfiguration?SDKVersion=6.4.1&systemVersion=15.2.1&packageName=com.companyName.ApplicationName&platform=iOS, NSErrorFailingURLKey=https://api.iterable.com/api/mobile/getRemoteConfiguration?SDKVersion=6.4.1&systemVersion=15.2.1&packageName=com.companyName.ApplicationName&platform=iOS, _kCFStreamErrorDomainKey=1}
2022-01-27 15:08:02.265379-0600 ApplicationName[1423:162945] ❤️ 15:08:02.2650:0x280a10ac0:InternalIterableAPI:checkRemoteConfiguration():625: Could not get remote configuration: bad URL, using saved value: false
), NSLocalizedDescription=bad URL, NSErrorFailingURLStringKey=https://api.iterable.com/api/inApp/[email protected]&SDKVersion=6.4.1&count=100&platform=iOS&systemVersion=15.2.1&packageName=com.companyName.ApplicationName, NSErrorFailingURLKey=https://api.iterable.com/api/inApp/[email protected]&SDKVersion=6.4.1&count=100&platform=iOS&systemVersion=15.2.1&packageName=com.companyName.ApplicationName, _kCFStreamErrorDomainKey=1}
), NSLocalizedDescription=bad URL, NSErrorFailingURLStringKey=https://api.iterable.com/api/inApp/getMessages?platform=iOS&packageName=com.companyName.ApplicationName&SDKVersion=6.4.1&count=100&systemVersion=15.2.1&[email protected], NSErrorFailingURLKey=https://api.iterable.com/api/inApp/getMessages?platform=iOS&packageName=com.companyName.ApplicationName&SDKVersion=6.4.1&count=100&systemVersion=15.2.1&[email protected], _kCFStreamErrorDomainKey=1}
), NSLocalizedDescription=bad URL, NSErrorFailingURLStringKey=https://api.iterable.com/api/users/registerDeviceToken?Api-Key=apiKey, NSErrorFailingURLKey=https://api.iterable.com/api/users/registerDeviceToken?Api-Key=apiKey, _kCFStreamErrorDomainKey=1}

Let me know if can provide any other details.

v6.0.8 release only compiles when targeting device platform (not simulators)

I upgraded my version of Iterable from v6.0.6 to v6.0.8 and found the newest version wasn't compiling when targeting the iOS simulator. The error message Xcode provides is a bit misleading indicating the compiler can't find any symbols that are part of Iterable's SDK.

After investigation, in v6.0.8 each framework's *-Swift.h file only the device platform is targeted (there's an elif defined(...) at the top where this occurs). I'm not sure if this is a regression related to Iterable's release process or something with Xcode 10.2's build system.

It looks like this might at least be partially due to a known issue when building with Xcode 10.2. Apple has instructions for a workaround where each target should be built separately and then the headers combined using an #ifdef preprocessor: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_release_notes#3136806

To test a fix, I built Iterable's SDK from source and used a run script build phase with lipo to merge the simulator and device frameworks into a single fat framework. Instructions for doing this can be found here: https://www.tirupatibalan.com/2019/01/05/create-fat-framework.html

The run script phase outlined in the link above for generating the fat framework isn't sufficient to handle the workaround necessary for Xcode 10.2 so I added an additional step that merges the two framework swift headers (it's not pretty but it works):

# 9
# Workaround for known issue in Xcode 10.2: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_release_notes#3136806
# Merge the simulator and device headers for the now-merged framework.
HEADER_PATH="${OUTPUT_DIR}/${FRAMEWORK_NAME}.framework/Headers/${FRAMEWORK_NAME}-Swift.h"
rm "${HEADER_PATH}"
echo "#if TARGET_OS_SIMULATOR" >> "${HEADER_PATH}"
cat "${OUTPUT_DIR}/Build/Products/Release-iphonesimulator/${FRAMEWORK_NAME}.framework/Headers/${FRAMEWORK_NAME}-Swift.h" >> "${HEADER_PATH}"
echo "#else" >> "${HEADER_PATH}"
cat "${OUTPUT_DIR}/Build/Products/Release-iphoneos/${FRAMEWORK_NAME}.framework/Headers/${FRAMEWORK_NAME}-Swift.h" >> "${HEADER_PATH}"
echo "#endif" >> "${HEADER_PATH}"

I tested my solution in a sample application and both platforms built successfully. Since the application contains x86 and i386 architectures any application consuming the framework will need to strip these before submission (the link above has instructions for doing that as well).

Would it be possible to release the latest version of the framework as a fat framework using the approach outlined above?

build error 'UIUserInterfaceIdiom' has no member 'mac'

getting the below error when building

iOS sdk version 6.1.4

[09:20:31]: ▸ Copying IterableSDK.h
[09:20:36]: ▸ ❌  /Users/xx/platforms/ios/Pods/Iterable-iOS-SDK/swift-sdk/Internal/DeviceInfo.swift:57:15: type 'UIUserInterfaceIdiom' has no member 'mac'
[09:20:36]: ▸         case .mac:
[09:20:36]: ▸                  ~                       ^~~~~~~~~~~~~

Unable to find a push integration set up for application xx on APNS_SANDBOX

I get the below error on my xcode console when iterable is initialised with apns token.

IterableAPIInternal:defaultOnFailure(identifier:):630: registerToken failed:, Unable to find a push integration set up for application xx on APNS_SANDBOX, got response {"msg":"Unable to find a push integration set up for application xx on APNS_SANDBOX","code":"BadParams","params":null}

Unrecognized selector exception on +updateSubscriptions...

+[IterableSDK.IterableAPI updateSubscriptions:unsubscribedChannelIds:unsubscribedMessageTypeIds:subscribedMessageTypeIds:campaignId:templateId:]: unrecognized selector sent to class 0x11311e040
(null)

Hey gang-- after updating to v6.2.4 (and the issue remains in 6.2.5), I am getting the crash above when I try to call the above method.

I note that recently you updated the name of this method to change the campaignIds parameter to campaignId which is fine, but although the header seems correct (and Xcode compiles my calling of its new name correctly), the method implementation seems not to be renamed (?)

This line of code below sets responds to YES telling me that perhaps the old declaration is still in the implementation. Note the compaignIds parameter with the s still on it like in the old versions:

BOOL responds = [IterableAPI respondsToSelector:@selector(updateSubscriptions:unsubscribedChannelIds:unsubscribedMessageTypeIds:subscribedMessageTypeIds:campaignIds:templateId:)];

I may be missing something really obvious, but could you have a quick look and see if you see anything that might explain my crash? Thank you.

Bitcode not working for Archive

Issue archiving with bitcode (for both main framework and extensions):

ld: bitcode bundle could not be generated because '...../Frameworks/IterableAppExtensions.framework/IterableAppExtensions' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build file '...../Frameworks/IterableAppExtensions.framework/IterableAppExtensions' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

isGhostPush bool no longer available

We ignore ghost push notifications to prevent inaccurate data in our internal analytics, but after updating the SDK, getPushMetadata and its isGhostPush var aren't available. Has this been moved or is the only way to get this information parsing the payload manually?

Sporadic crashes due to ([UIColor systemBackgroundColor]: unrecognized selector sent to class - Fatal Exception: NSInvalidArgumentException)

In our application we are using Iterable version 'Iterable-iOS-SDK', '6.2.8' and we are seeing sporadic crashes. We can not reproduce the crash in a certain way. Currently we are not making any calls to [UIColor systemBackgroundColor]. After looking at the stack trace, we feel like Iterable SDK might be causing the issue.

We went over the list of release notes since there are newer version of the SDK however we haven't seen anything regarding this issue.

I was wondering if you guys had addressed such issue in the newer releases ? Any help would be appreciated.

Here's the stack trace (firebase - crashlytics)

Fatal Exception: NSInvalidArgumentException
[UIColor systemBackgroundColor]: unrecognized selector sent to class 0x23e240158 [NSOrderedSet orderedSetWithSet:]

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x204dfb180 __exceptionPreprocess
1  libobjc.A.dylib                0x203fd39f8 objc_exception_throw
2  CoreFoundation                 0x204d1ca08 +[NSOrderedSet orderedSetWithSet:]
3  CoreFoundation                 0x204e009c8 ___forwarding___
4  CoreFoundation                 0x204e0265c _CF_forwarding_prep_0
5  IterableSDK                    0x1023bcd38 (Missing)
6  IterableSDK                    0x1023ca728 (Missing)
7  IterableSDK                    0x1023d3898 (Missing)
8  IterableSDK                    0x102408890 (Missing)
9  libdispatch.dylib              0x204838a38 _dispatch_call_block_and_release
10 libdispatch.dylib              0x2048397d4 _dispatch_client_callout
11 libdispatch.dylib              0x2047e7008 _dispatch_main_queue_callback_4CF$VARIANT$mp
12 CoreFoundation                 0x204d8cb20 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
13 CoreFoundation                 0x204d87a58 __CFRunLoopRun
14 CoreFoundation                 0x204d86fb4 CFRunLoopRunSpecific
15 GraphicsServices               0x206f8879c GSEventRunModal
16 UIKitCore                      0x23142ec38 UIApplicationMain
17 XoaInfoPlug1.dylib             0x1055ceb9c (Missing)
18 Project XXX                  0x10040b840 main + 14 (main.m:14)
19 libdyld.dylib                  0x20484a8e0 start

Callback after in-app messages have finished displaying, even if there are no in-app messages

Hi,

I'm working to integrate this SDK in our app and I would like to have some more fine-grained feedback from the SDK on when in-app messages have finished displaying.

My use-case is this: We have a series of modal pop-ups in the app that may or may not display when the user logs in. We want to avoid displaying these modal pop-ups on top of each other, so each modal fires a callback when it is "done". It does this in two cases:

  1. It doesn't need displaying
  2. It has displayed, and the user has closed it

I would like to have the same functionality for Iterable in-app messages.

The documentation for release 6.0.6 says this:

To display the user's InApp notifications call spawnInAppNotification with a defined ITEActionBlock callback handler. When a user clicks a button on the notification, the defined handler is called and passed the action name defined in the InApp template.

A suggestion would be for this callback to be called even if there are no in-app messages to display. That way I know that when the callback has been called it is safe to continue displaying other modal pop-ups to the user.

I've seen that you're in the process of reworking how in-app messages work on the master branch, so I would like for your new solution to be able to solve my use-case.

Iterable SDK hanging my app

About 1/2 of my production crashes right now are from my app hanging on startup, on this line of code which is called when starting the Iterable SDK:
https://github.com/Iterable/swift-sdk/blob/master/swift-sdk/Internal/IterableAppIntegrationInternal.swift#L29
(I have to add, your spelling of semaphore is not inspiring a lot of confidence, lol.)

This affects less than 0.5% of my sessions, but it is still high enough to get my attention. Crashes occur on iPhone & iPad devices running various versions of iOS 14 & 15. My app was running Iterable iOS SDK v6.3.3 for all of these crashes.

Here is a full stack trace from my crash reporter:

App Hang: The app was terminated while unresponsive

0  libsystem_kernel.dylib _semaphore_wait_trap
1  libdispatch.dylib      __dispatch_sema4_wait
2  libdispatch.dylib      __dispatch_semaphore_wait_slow
3  Trala                  notificationsEnabled.get (IterableAppIntegrationInternal.swift:29:24)
4  Trala                  notificationsEnabled.get (<compiler-generated>)
5  Trala                  register (InternalIterableAPI.swift:152:31)
6  Trala                  register (IterableAPI.swift:208:33)
7  Trala                  application (AppDelegate.swift:126:21)
8  Trala                  application (<compiler-generated>)
9  libdispatch.dylib      __dispatch_call_block_and_release
10 libdispatch.dylib      __dispatch_client_callout
11 libdispatch.dylib      __dispatch_main_queue_callback_4CF
12 CoreFoundation         ___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
13 CoreFoundation         ___CFRunLoopRun
14 CoreFoundation         _CFRunLoopRunSpecific
15 GraphicsServices       _GSEventRunModal
16 UIKitCore              -[UIApplication _run]
17 UIKitCore              _UIApplicationMain
18 Trala                  main (main.swift:29:1)
19 <unknown>              0x105315a20

Please let me know if you need more info.

ios9 cannot run

Hi
I see in the documentation that ios9 is supported
But when I added UNNotificationServiceExtension, it cannot run on ios9 devices.
I know that UNNotificationServiceExtension can only be run on devices after ios10, so the documentation does not lack the minimum version support instructions for UNNotificationServiceExtension? Still, there are some special settings for ios9 devices I haven't done right.

Ordering of in-app messages

Hi,

I have a question regarding ordering of in-app messages sent to a user. The docs mention that in-app messages are stored in a queue, which would imply a first in, first out (FIFO) behavior.

Let's say I send three in-app messages to user A, in the following order: M1, M2, M3.

If I then do this: IterableAPI.inAppManager.getMessages().first, which message would that be? The one that the user received first (M1), or the last one sent (M3)?

Thanks
Viktor

6.x Release SDKs binaries are missing simulator architectures

The resulting fat universal binary is missing simulator architectures from all frameworks for the past couple of months:

IterableSDK: Mach-O universal binary with 2 architectures: [arm_v7:Mach-O dynamically linked shared library arm_v7] [arm64]
IterableSDK (for architecture armv7):   Mach-O dynamically linked shared library arm_v7
IterableSDK (for architecture arm64):   Mach-O 64-bit dynamically linked shared library arm64

Note the absence of i386 and x86_64.

scripts/build-target-module-framework.sh is failing to trap/check error codes and lipo is failing with:

fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: build/Release-iphonesimulator/IterableSDK.framework/IterableSDK and build/Release-iphoneos/IterableSDK.framework/IterableSDK have the same architectures (arm64) and can't be in the same fat output file
  1. proper error checking should be added to all script commands
  2. the xcodebuild commandline for iphonesimulator should have EXCLUDED_ARCHS="arm64" added to it
  3. the frameworks should be converted to xcframeworks

2 should be quick temporary solution until 3 can be done and should only impact folks with DTK/arm64 mac who try to use the simulator.

3 would additionally address the issue with DTK/arm64 macs, but might have a larger impact on all the current consumers of the frameworks forcing them to upgrade their toolchains and adjust their projects etc.

And of course both 2 and 3 could be done for maximum compatibility for some time, giving users a chance to migrate to the newer xcframework builds once available.

'shared' is unavailable: not available on iOS (App Extension) on Xcode 13 beta 3

Describe the bug
The package is not compiling on Xcode 13 beta 3, shows this error: 'shared' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead

Steps to reproduce the behavior:
Open your project using Xcode 13 beta 3
Clean project
Build Project
See error

Expected behavior:
Package compiles successfully

Versions
Xcode: 13.0 beta 3 (13A5192j)
Mac OS: 11.4
Library Version: 6.5.6

Additional context
There is a thread here https://forums.swift.org/t/set-application-extension-api-only-on-a-spm-package/39333/17 which explains the issue.

App in the foreground,Message UI problem

Hello, I have successfully integrated Iterable-iOS-SDK, but when I tried to send push messages [Message Medium (Push)], if APP was running in the foreground(UIApplicationStateInactive), it found that the method of calling Iterable had no UI effect, received messages but did not show the UI, does SDK support this kind of display at present?

-(void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler
{
[IterableAppIntegration application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}

I tried to see the effect of SDK implementation, that in the active state, they are all direct breaks.

IterableAppIntegration:

func application(_ application: ApplicationStateProviderProtocol, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: ((UIBackgroundFetchResult)->Void)?) {
…..

        switch application.applicationState {
        case .active:
            break
        case .background:
            break

…..
}

Campaign IDs not correctly decoded

Summary

Following up from the discussion over on the Android SDK side of things (see here: Iterable/iterable-android-sdk#223), it would appear as though the Swift SDK is not adhering to the API contract that campaignId is a long.

When we receive an In-App message from a campaign, using an SSL proxy I can clearly see the campaignId coming over as a naked number, but the SDK is trying to decode it as a String. I am confident this is causing all messages received to have empty campaign ID strings. At least, it has been the case with all the messages I have tested with.

Steps to Reproduce

  1. Set up the SSL proxy for iOS simulators on your environment (if using Charles, see here for instructions: https://www.detroitlabs.com/blog/2018/05/01/how-to-set-up-charles-proxy-for-an-ios-simulator/)
  2. Ensure the SSL proxy is working by sending a proof to your developer account and observing the message JSON in your proxy.
  3. Set up a breakpoint somewhere just before displaying the message so that the Iterable Swift SDK has parsed the JSON into an IterableInAppMessage object.
  4. Create a campaign in app.iterable.com targeting one user (in our case, our mobile dev email)
  5. Send the campaign and note the Campaign ID assigned to it from app.iterable.com.
  6. Observe the received campaign message JSON has a numeric clientId via your proxy.
  7. As soon as execution breaks at your breakpoint, inspect the received, decoded IterableInAppMessage object with Xcode.
  • Expected Result: The IterableInAppMessage clientId is correct.
  • Actual Result: The IterableInAppMessage clientId is always an empty string.

Relevant Info

  • SDK Version: 6.1.2
    • Looking at the source, it doesn't look like the decoding logic has changed since this version to the latest stable version as of writing this.
  • Mobile device: any iOS simulator with iOS 10+ 12+ <-- sorry about that confusion.
  • SSL Proxy Tool: Charles

Multiple commands produce Assets.car

6.2.0 uses resource in the podspec, which means this version cannot be used in projects that use static libraries due to a name conflict.

The cocoapods documentation strongly recommends using resource_bunldes instead to avoid this.

Version 6.4.0 fails to compile when archiving

I am running Xcode 13.2 on both CI and on desktop.

When archiving my app with Iterable iOS SDK version 6.4.0 integrated using Swift Package Manager, either in CI or on desktop, I get the following compile errors (these errors were generated on CircleCI):

❌  /Users/distiller/project/Packages/checkouts/swift-sdk/swift-sdk/swiftui/InboxViewRepresentable.swift:22:40: cannot find type 'Context' in scope

    func makeUIViewController(context: Context) -> IterableInboxViewController {
                                  ^~~~~

❌  /Users/distiller/project/Packages/checkouts/swift-sdk/swift-sdk/swiftui/InboxViewRepresentable.swift:34:91: cannot find type 'Context' in scope

    func updateUIViewController(_ uiViewController: IterableInboxViewController, context: Context) {
                                       ^~~~~~~

❌  /Users/distiller/project/Packages/checkouts/swift-sdk/swift-sdk/swiftui/InboxViewRepresentable.swift:11:32: cannot find type 'UIViewControllerRepresentable' in scope

struct InboxViewRepresentable: UIViewControllerRepresentable {
                                                                                          ^~~~~~~

❌  /Users/distiller/project/Packages/checkouts/swift-sdk/swift-sdk/swiftui/IterableInboxView.swift:73:27: cannot find type 'View' in scope

    public var body: some View {
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

❌  /Users/distiller/project/Packages/checkouts/swift-sdk/swift-sdk/swiftui/IterableInboxView.swift:11:34: cannot find type 'View' in scope

public struct IterableInboxView: View {
                          ^~~~

When not archiving (i.e. building on desktop or running tests on CI) the Iterable SDK builds correctly.
In the interim, I have rolled back to a previous version of the Iterable SDK to complete my build.

Please investigate.

Type 'IterableHtmlInAppContent' does not conform to protocol 'Decodable'

@objcMembers
public class IterableHtmlInAppContent : NSObject, IterableInAppContent, Codable {

is throwing the error:

Type 'IterableHtmlInAppContent' does not conform to protocol 'Decodable'

Looks like the init function needs to be change. I am on Swift 4 with XCode Version 10.1. This is for Iterable-iOS-SDK 6.1.0-beta3.

IterableHtmlMessageViewController with no content and blocking interaction with the app

Hello Iterable Team,
I noticed a bug in the app that when a button has no "action" or "url" is empty the SDK add a IterableHtmlMessageViewController on top of the hierarchy blocking any interaction with the app, the user needs to force quit the app in order to continue using it, I wonder if could you add some validation in the SDK to prevent this behavior.

this is an example of the template I'm using:
<a class="btn" href="">LET ME SEE !</a> <a class="btn2" href="action://dismiss">I'M GOOD</a>
the button "I'M GOOD" close the in-app message but the button "LET ME SEE!" trigger to show the IterableHtmlMessageViewController with no content blocking the interaction with the app. I'm using the SDK 6.2.0

Thanks! and keep doing a great job with this SDK! we love it!

Screen Shot 2020-03-03 at 9 09 08 AM

Version 6.4.1 fails to create simulator artifact when using SPM

NOTES:

  • Your derived data must be clean. If you previously built successfully inside Xcode you can not recreate this issue. It only happens on a clean build.
  • This is very similar to #523 but specifically for simulators.
  • Reverting to version 6.3.4 will successfully generate a simulator artifact.
  • I'm using Xcode 13.2.1
  • I'm using Swift Package Manager

When I attempt to archive my app for a simulator, to upload to Saucelabs for automated UI testing, the build fails.

Command: xcodebuild -scheme Pinseeker -project ./Project.xcodeproj -configuration Adhoc -derivedDataPath scan_derived_data -destination 'platform=iOS Simulator,name=iPhone 13' -archivePath archives/simulator_build/Project.simulator\ 2022-02-10\ 17.43.43.xcarchive archive

Errors:

The following build commands failed:
	CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'IterableSDK' from project 'IterableSDK')
	CompileSwiftSources normal i386 com.apple.xcode.tools.swift.compiler (in target 'IterableSDK' from project 'IterableSDK')
	CompileSwift normal i386 (in target 'IterableSDK' from project 'IterableSDK')
	CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'IterableSDK' from project 'IterableSDK')
❌  /Users/me/GitHub/pinseeker-ios/scan_derived_data/spm/checkouts/swift-sdk/swift-sdk/swiftui/InboxViewRepresentable.swift:22:40: cannot find type 'Context' in scope

    func makeUIViewController(context: Context) -> IterableInboxViewController {
                                       ^~~~~~~



❌  /Users/me/GitHub/pinseeker-ios/scan_derived_data/spm/checkouts/swift-sdk/swift-sdk/swiftui/InboxViewRepresentable.swift:34:91: cannot find type 'Context' in scope

    func updateUIViewController(_ uiViewController: IterableInboxViewController, context: Context) {
                                                                                          ^~~~~~~



❌  /Users/me/GitHub/pinseeker-ios/scan_derived_data/spm/checkouts/swift-sdk/swift-sdk/swiftui/InboxViewRepresentable.swift:11:32: cannot find type 'UIViewControllerRepresentable' in scope

struct InboxViewRepresentable: UIViewControllerRepresentable {
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~



❌  /Users/me/GitHub/pinseeker-ios/scan_derived_data/spm/checkouts/swift-sdk/swift-sdk/swiftui/IterableInboxView.swift:73:27: cannot find type 'View' in scope

    public var body: some View {
                          ^~~~



❌  /Users/me/GitHub/pinseeker-ios/scan_derived_data/spm/checkouts/swift-sdk/swift-sdk/swiftui/IterableInboxView.swift:11:34: cannot find type 'View' in scope

public struct IterableInboxView: View {

Carthage integration is broken on Release 6.4.1

The build log reads:

Touch /Users/carlos/Library/Caches/org.carthage.CarthageKit/DerivedData/13.2.1_13C100/swift-sdk/6.4.1/Build/Products/Release-iphonesimulator/IterableAppExtensions.framework (in target 'notification-extension' from project 'swift-sdk')
    cd /Users/carlos/Documents/iOS_Projects/work/merryfield-ios/Carthage/Checkouts/swift-sdk
    /usr/bin/touch -c /Users/carlos/Library/Caches/org.carthage.CarthageKit/DerivedData/13.2.1_13C100/swift-sdk/6.4.1/Build/Products/Release-iphonesimulator/IterableAppExtensions.framework

** BUILD FAILED **


The following build commands failed:
	CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'swift-sdk' from project 'swift-sdk')
	CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'swift-sdk' from project 'swift-sdk')
	CompileSwiftSources normal i386 com.apple.xcode.tools.swift.compiler (in target 'swift-sdk' from project 'swift-sdk')
	CompileSwift normal i386 (in target 'swift-sdk' from project 'swift-sdk')

Xcode 13.2.1
Carthage 0.38

Macbook Pro M1

Cocoapods installation not working

As mentioned in the automatic installation instructions I add the following to my pod file:
pod 'Iterable-iOS-SDK'

Then I do:
pod install

After that I open the workspace for my project, compile it, and I get the following compilation error:

Pods/Iterable-iOS-SDK/swift-sdk/IterableSDK.h:19:9: 'IterableSDK/IterableConstants.h' file not found

Is this a known issue? I'm on Xcode Version 10.1 (10B61).

Thanks!

UIWebView deprecated

As the title states. Apple will start rejecting apps still using this. Below is the email I received.


We identified one or more issues with a recent delivery for your app, ________ . Your delivery was successful, but you may wish to correct the following issues in your next delivery:

ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs . See https://developer.apple.com/documentation/uikit/uiwebview for more information.

After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to App Store Connect.

Best regards,

The App Store Team

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.