Giter VIP home page Giter VIP logo

exponea-ios-sdk's People

Contributors

adam1929 avatar alphatroya avatar andrewlloyd100 avatar ankmara avatar dominik-hadl avatar gpizanoc avatar igor-liska avatar ikalyuzhniy avatar michaela-dev avatar narciszait avatar nharbo avatar nickskull avatar nvankampenhout avatar ricardotokashiki avatar wassil avatar xcibik00 avatar

Stargazers

 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

exponea-ios-sdk's Issues

Cannot install 2.16.0 using Carthage

When running carthage update --platform iOS --cache-builds --use-xcframeworks with this Cartfile:

github "exponea/exponea-ios-sdk" == 2.16.0

I am getting this error

*** Fetching exponea-ios-sdk
*** Checking out exponea-ios-sdk at "2.16.0"
*** xcodebuild output can be found in /var/folders/_s/x8bvjnf17576wt6pz70ybtk00000gn/T/carthage-xcodebuild.RrC5lL.log
The dependency graph contained a cycle:
exponea-ios-sdk: SwiftSoup

I assume the cause is that since 2.15.2 "Cartfile" changed to "cartfile" which seems to be invalid. I would create a PR but none of my PRs ever got merged. Please fix ASAP thanks.

Unable to install via Carthage

Screenshot 2021-04-27 at 15 35 51

looks like you update the code to better support SPM, but forgot to do the same for other package managers :)

also, with SPM, you needs exclude plists from from sources, others it will yield warnings

AppStore upload failed

Hi, we faced a problem with uploading a new version of our application to the App Store with received errors:

  • ITMS-90205
  • ITMS-90206

After a short investigation in your latest release, I found the settings for ExponeaSDK target has 2 dependencies:

  • ExponeaSDKObjC
  • ExponeaSDKShared

Both of those dependencies have an embed style as Embed & Sign that is the problem cause frameworks don't have allowed containing any nested bundles, which in that case are real frameworks.

Other than that, you should consider enabling the flag BUILD_LIBRARY_FOR_DISTRIBUTION to enable library evolution support for built frameworks.

Delivered Event not triggered for users who update their app to one which integrates Bloomreach

It may be worth updating documentation to clarify how users with existing push tokens should configure the service extension.

We configured our push implementation using the following documentation:

We were migrating from an existing provider to Bloomreach so already had push tokens and consent for many of our users. After importing the tokens to Bloomreach we observed that we weren't seeing 'Delivered' events for many of our users.

The documentation describes calling .configure in didFinishLaunchingWithOptions. While this will work for users who open the app, any push notifications that trigger the service extension before the app is opened will not be able to track 'Delivered'.

  1. Is it safe to call .configure and .identify multiple times with the same parameters, in the service extension and main app?
  2. You may want to consider updating the documentation to reflect the need to call .configure and .identify in the service extension to handle the case where a user is backfilling with existing push tokens and app opens are infrequent.

Fatal on Push Notification Opening

I have encountered a further Issue when sending a push notification, when user taps the notification, app opens and then fatal error occurs in SDK:

Fatal on this line of the PushNotificationManager+NSObject class:

guard let originalMethod = class_getInstanceMethod(type(of: self), selector), let swizzle = Swizzler.swizzles[originalMethod] else { return }

also appears to call this func over and over in the stack trace

curriedImplementation(self, selector, center, response, completionHandler)

Is there any additional config required in the app when NOT using rich push notifications? As the demo app implies not but why is this crash occurring if thats the case? Appreciate guidance on this

Update code for latest Swift (5.3+) versions & address warnings

As Swift has been evolving, some changes in the language alone (mainly around the 4.x/5.x version edges) lead to some of the conventions being deprecated.

At this moment with Xcode 13 (and AFAIK also previously with Xcode 12 cycle), a couple of warnings appears when building the library:

Screenshot 2022-01-10 at 22 31 21

This is a very minor change required, so addressing this should be a half-an-hour job in fact. 👍 Taking it practically, App Store currently requires Xcode 12 to be used to build any bundle deployed there, that means Swift 5.3 is effectively the oldest version supported. Your Package.swift file already states this, thus fixing this shouldn't really cause conflicts in any 3rd-party project. 👌

Exponea cant detect projectToken when using .plist init

Hi, I am initialising exponea with the below configuration

<dict>
	<key>authorization</key>
	<string>Token redacted token</string>
	<key>automaticPushNotificationTracking</key>
	<true/>
	<key>sessionTimeout</key>
	<integer>20</integer>
	<key>projectToken</key>
	<string>redacted project id</string>
	<key>projectMapping</key>
	<dict/>
	<key>lastSessionStarted</key>
	<integer>0</integer>
	<key>lastSessionEnded</key>
	<integer>0</integer>
	<key>autoSessionTracking</key>
	<false/>
	<key>baseURL</key>
	<string>https://api.exponea.com</string>
</dict>

I call: Exponea.shared.configure(plistName: configPath) with the above file

Then when I call Exponea.shared.identifyCustomer

I get a fatal crash on:

var request = URLRequest(url: URL(string: path)!) in the request factory

aswell as a print of 'ExponeaSDK ❗️ ERROR [Configuration.swift]:164 tokens(for:): No project token found.'

It would appear Exponea isnt reading the projectID from the config correctly? but it appears to be included in the request URL path just fine, so not sure if this is a bug?

Thanks

How to set properties without plist?

I didnt find any way to set automaticPushNotificationTracking to false without a plist which is not safe as anyone can pull it out from the packaged *.ipa and read our tokens and it also makes it more complex to have multiple environments.

What would you recommend? Could you extend the code-based configuration capabilities?

UIApplication.shared.registerForRemoteNotifications() is called on a background thread

The Main Thread Checker is complaining about the UIApplication.shared.registerForRemoteNotifications() is being called from a background thread. According to the stack trace I can see it's being called from the callback after checking if the UNNotificationCenter is authorized (UNAuthorizationStatusProvider.current.isAuthorized).

I found this piece in the PushNotificationManager where you call the UIApplication.shared.registerForRemoteNotifications() in the completion handler. This is not guaranteed to be called on the Main Thread so it should be wrapped in a DispatchQueue.main.async {} or similar.

From Xcode:
CleanShot 2020-07-22 at 12 57 35

Request self-check push & Test Notification not working

Hi,

I've tried to configure push notification but i'm not able to send test push via website and SDK fails at Request self-check push step.

IMG_4322

When i try to send test push message from website to single / test customer (with apple_push_notification_id set up) I get 400 Bad Request error popup.

APNS configuration is set up properly in Project Settings and test customer is having both apple_push_notification_id and apple_push_notification_authorized properties.

On iOS App it fails at last step. I've tried look at request iOS SDK is making and url, project_id, Authorization and httpBody looks ok but the response is
BadRequest: The browser (or proxy) sent a request that this server could not understand.

Im using public API with very limited access (email, apple_push_notification_id, apple_push_notification_authorized).

Is there anything that i'm missing? I run through documentation for both iOS and Android and i can't find anything that could be wrong. I suspect it might be because of public API restrictions but i couldn't find what else should be enabled to be able to send push notifications.

Push Token not setting in Exponea but SDK is sending it

Hi,

Im moving from the automatic swizzling handling of notifications to the new method using ExponeaAppDelegate

In the logging i see:

2020-09-10 05:23:29374 ExponeaSDK ℹ️ VERBOSE [TrackingManager.swift]:184 track(_:with:): Tracking event of type: registerPushToken with params [ExponeaSDK.DataType.pushNotificationToken(token: Optional("TOKENSTRING"), authorized: true)]

However in exponea the userID has no token. Please can you advise what could be wrong here, I dont see any errors...

All other tracking and events are visible in exponea, its just not adding the push token...

Unable to change configuration

We have specific problem with our iOS app in Notino. We need to change configuration and switch to different project during runtime. We have multiple languages in app, that we switch accordingly to country and we have different projects for each country. I found in Exponea SDK, that configuration is possible only once. Is there any way to change projectToken during runtime?

Exponea SDK is broken since 2.12.0

Getting an error during configuration – complaining about database initialisation. Referenced in our project as a source Swift package.

My guess would be this change made in that release:

//        #if SWIFT_PACKAGE
//        let bundle = Bundle.module
//        #else
//
//        #endif

so that the proper Bundle, thus the database model file as well, can't be resolved properly.

That release seems to be pretty wild on its own, with +14000 line diff, not really reviewed or tested properly, seems like.

Enabling/disabling `automaticSessionTracking` on the fly after 2.9.0

From the 2.9.0 release notes:

BREAKING CHANGE: The SDK can only be configured once. Reconfiguration of the SDK caused some of the handlers to be registered multiple times which then resulted in automatic events to be tracked multiple times. You should be able to change most of the setting on the fly. To change project tokens, you can use anonymize() method (see ANONYMIZE.md)

We are enabling and disabling the automaticSessionTracking on the fly (eg. when the user change tracking settings or signs out). As we can no longer call the Exponea.shared.configure(...) more than once we need another way of changing this setting. I can't seem to find that anywhere in the documentation and that's why I'm writing here.

Could you please help us out?

Thanks.

BTW. What are your thoughts about introducing breaking changes in minor releases? I think it would be appropriate to bump the major version number when introducing breaking changes like this so it's very clear.

Self check not working

Self check does not work, because we check if we are running a debug version of the app.

The code to check that we are running a debug version uses an outdated technique that doesn't seem to work.

From BuildConfiguration.swift:

// based on https://forums.swift.org/t/support-debug-only-code/11037

func inDebugBuild(_ code: () -> Void) {
    assert({
        code()
        return true
        }()
    )
}

Since the SDK is a dependency of our application, the assert will never run. Therefore this function wouldn't work as expected.

Failing to configure SDK

I am attempting to add the SDK to a new app however its failing when I call Exponea.shared.configure.

App Delegate

class AppDelegate: ExponeaAppDelegate {
    override func application(
            _ application: UIApplication,
            didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
        ) -> Bool {
            super.application(application, didFinishLaunchingWithOptions: launchOptions);
            Exponea.shared.checkPushSetup = true;
            Exponea.logger.logLevel = .verbose;

            Exponea.shared.configure(Exponea.ProjectSettings(
                projectToken: "...",
                authorization: .token("..."),
                baseUrl: "https://cloud-api.exponea.com"
            ), pushNotificationTracking: .enabled(appGroup: "..."))
            return true
    }
}

Logs

⚙️ Starting ExponeaSDK, version 2.24.0.
2024-03-26 11:44:28497 [EXP-iOS] ℹ️ VERBOSE [ExponeaInternal.swift]:229 sharedInitializer(configuration:): Configuring Exponea with provided configuration:
[Configuration]
Project Token: ...
Authorization: Token Authorization (token redacted)
Base URL: https://cloud-api.exponea.com
Session Timeout: 6.0
Automatic Session Tracking: true
Automatic Push Notification Tracking: false
Require Push Authorization: false
Token Track Frequency: onTokenChange
Flush Event Max Retries: 5
App Group: ...
Default Customer Props allowed: true
Advanced authorization Enabled: false
Fatal error: NSArray element failed to match the Swift Array Element type
Expected Customer but found Customer
2024-03-26 11:44:28.502778+0000 bloomreach[12923:575853] Fatal error: NSArray element failed to match the Swift Array Element type
Expected Customer but found Customer

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

Can't start build process due to this problem:
Could not find module 'ExponeaSDK' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator at: /Users/name/Library/Developer/Xcode/DerivedData//Index.noindex/Build/Products/Debug-iphonesimulator/ExponeaSDK.swiftmodule

Tried to update dependency to pod "ExponeaSDK", "~> 2.20.0", and changed all necessary config in my Xcode project.
Any advice to solve this problem?

Xcode version: 15.0.1
Computer: Mac M1

App Hanging inside the SDK

Xcode 12 warnings, NSSecureCoding

Xcode 12 shows buildtime warnings about some core data attributes usinf insecure value transformer.

Customer.uuid is using a nil or insecure value transformer. Please switch to NSSecureUnarchiveFromDataTransformerName or a custom NSValueTransformer subclass of NSSecureUnarchiveFromDataTransformer
and
KeyValueItem.value is using a nil or insecure value transformer. Please switch to NSSecureUnarchiveFromDataTransformerName or a custom NSValueTransformer subclass of NSSecureUnarchiveFromDataTransformer

Are you planning to fix this issue in near future?

DatabaseManager waits on main queue

Just noticed this when profiling our app - DatabaseManager.swift uses the context property for interacting with Core Data. This is defined as persistentContainer.viewContext. This means that context is associated with the main queue as described in the docs. All operations in DatabaseManager begin with context.performAndWait - perform and performAndWait run the block on the queue that the context is associated with... in this case, the main queue.

Since performAndWait is run synchronously on the context's queue, the main queue is blocked while DatabaseManager methods are run. This results in our app freezing when the database manager decides to do something.

As far as I know, there is nothing the app can do about this. Please let me know if my analysis is wrong, but I can't find anything else in the time profiler to explain this.

Internal extensions polluting global scope

Swift extensions on system objects, e.g. Array[safeIndex:] or String(safeString:) are polluting global scope because they are declared as public.

Problem - the functions declared in these extensions conflict with extensions that have the same name in the app itself.

Note that Swift extensions do not always require the module to be imported. It is enough for the module to be imported in other files of the same module and these public methods will cause name conflicts.

Proposed solutions:

  1. do not make these extensions public (ideal)
  2. give these functions unique name (e.g. init(exponeaSafeString:)).

Objective C support

Has anyone tried integrating with the Objective C project? I need some info or guidelines to make the SDK work with the Objective C project.

Issues with the new HTML parsing feature

I've identified another couple of issues coming with the introduced HTML parsing in the SDK.

For one, I've just noticed that the repository now contains a SwiftSoup.xcframework in a binary form, almost 40MBs of binaries! That's something I'd really prevent from happening in the first place, not just because of some repository rule to not contain (binary) files over 1MB in general, but also as it forces anyone linking the Swift package to check out this file, mainly on every CI build for example – that's all unnecessary traffic as we have to check out the SwiftSoup package repository as well due to it being a dependency. I can't find a good reason this is included & referenced by the included Xcode project as it should be probably kept there as a Swift package dependency as well.

The worse part is, even removing it now would probably not help very much as it will be kept in the GIT history, so as long as SwiftPM does a full repository checkout of all packages, it will probably stick this way forever. Being it my repository, I'd probably revise all the recent commits with it, drop it & create an alternative branch flow with it omitted, but that really needs someone handling GIT properly for that to result in a non-harming state (but it's possible, tho, even without no discomfort for 3rd-parties 👍 I could give you some hints).

Secondly, I haven't really checked the Exponea code recently, but what I found in the related HtmlNormalizer.swift is really a poorly handled code – throwing exceptions I'm not really sure we can always do something about, thus not being sure about its safety. What concerns me the most is a use of force unwrapping which is (in our own project) prohibited, forcing us to work with more sane flows (mostly early guarding in these cases). Additionally, it gives me the impression this dependency is only there to do some minor tweaks (fixing issues in the backend-generated code to display?), not really feeling like the cost/benefit of using it being very positive.

I'd welcome to see an improvement in these things around. 🙏

In App Messages crash on start

Hi,

There are multiple crash reports (Firebase) in our app using Exponea regarding In App Messages. These crashes are occurring in the first few second after launch.

Our guess is it's maybe some data race during messages preloading.

Here's our Exponea setup:
(Called in application(_ application: UIApplication, didFinishLaunchingWithOptions))

Exponea.shared.checkPushSetup = true
Exponea.shared.configure(
    Exponea.ProjectSettings(
        projectToken: #TOKEN#,
        authorization: .token(#TOKEN#),
        baseUrl: #BASE_URL#,
        projectMapping: nil
    ),
    pushNotificationTracking: .disabled
)
Exponea.shared.identifyCustomer(customerIds: #IDS#, properties: #PARAMS#, timestamp: nil)
Exponea.shared.trackSessionStart()

Crash stack of the crash:

Crashed: com.apple.root.background-qos
0  libswiftCore.dylib             0x3da1bc _swift_release_dealloc + 32
1  libswiftCore.dylib             0x3cb334 swift_arrayDestroy + 124
2  libswiftCore.dylib             0xd2cb0 _DictionaryStorage.deinit + 624
3  libswiftCore.dylib             0xd2cd8 _DictionaryStorage.__deallocating_deinit + 16
4  libswiftCore.dylib             0x3da1d4 _swift_release_dealloc + 56
5  libswiftCore.dylib             0x3cb334 swift_arrayDestroy + 124
6  libswiftCore.dylib             0xa2904 _ContiguousArrayStorage.__deallocating_deinit + 96
7  libswiftCore.dylib             0x3da1d4 _swift_release_dealloc + 56
8  ExponeaSDK                     0x6fda0 $s10ExponeaSDK20InAppMessagesManagerC0cD18MessageShowRequestVwxx + 24
9  libswiftCore.dylib             0x3cb334 swift_arrayDestroy + 124
10 libswiftCore.dylib             0xa2904 _ContiguousArrayStorage.__deallocating_deinit + 96
11 libswiftCore.dylib             0x3da1d4 _swift_release_dealloc + 56
12 ExponeaSDK                     0x6cb50 $s10ExponeaSDK20InAppMessagesManagerC011showPendingcD7Message33_6232BDC4C73187DF2D383A3C0AEE6161LL06pickedI0yAC0cdI11ShowRequestV_AA0cdI0VtSg_tF + 540
13 ExponeaSDK                     0x6bad0 $s10ExponeaSDK20InAppMessagesManagerC13preloadImages02indE010completionySayAA0cD7MessageVG_yycSgtF + 520
14 ExponeaSDK                     0x6b8a4 $s10ExponeaSDK20InAppMessagesManagerC7preload3for10completionySDyS2SG_yycSgtFyycfU_yAA6ResultOyAA0cdE8ResponseVGcfU_yycfU_ + 2148
15 ExponeaSDK                     0x4a558 $sIeg_IeyB_TR + 28
16 libdispatch.dylib              0x24b4 _dispatch_call_block_and_release + 32
17 libdispatch.dylib              0x3fdc _dispatch_client_callout + 20
18 libdispatch.dylib              0x15b8c _dispatch_root_queue_drain + 684
19 libdispatch.dylib              0x16284 _dispatch_worker_thread2 + 164
20 libsystem_pthread.dylib        0xdbc _pthread_wqthread + 228
21 libsystem_pthread.dylib        0xb98 start_wqthread + 8

Can you please take a look at this a let us know if you find anything that could be causing the crashes?

Thank you

SPM support

Hello, do you have any plans to support Swift Package Manager?

BC-breaking use of `isElementFullscreenEnabled`

In Xcode 13.4.1/iOS 15.5 SDK, WKPreferences.isElementFullscreenEnabled is defined as API_AVAILABLE(macos(12.0), ios(15.0)). However in Xcode 14/iOS 16 SDK, this has been changed to API_AVAILABLE(macos(12.3), ios(15.4)) – this can be seen both in the reference for the property in Xcode 14 as well as on Apple Documentation website. Apple screwed it here, but they probably have reasons to rise that requirement in the end.

Because of this line:

        if #available(iOS 15.0, *) {
            preferences.isElementFullscreenEnabled = false
        }

Exponea package fails to compile in Xcode 14.

I'd suggest to simply rise the if #available condition to 15.4, just so it can be compiled now with Xcode 13.4.1 as well as later on with Xcode 14.

Now I can see I'm duplicating #37 😅 but doing it this way would allow building Exponea everywhere, with no public API being broken as this mentioned code is internal. 👍

Xcode 14 is also in RC so there's not really a high probability this will change.

Rich push notifications

Hello,
I am using Exponea SDK 2.14.0.
iOS deployment targets iOS 14.0 for both extensions and the app.
I am following this guide:
https://github.com/exponea/exponea-ios-sdk/blob/develop/Documentation/Guide/PUSH_QUICKSTART.md

Notifications are working fine but the Rich push notifications with images and buttons do not work properly.
I receive the notification but once I long press it nothing is happening.
Please review the Documentation for some missing configuration details.

Multiple flush timers

Hi, I'm using the periodic flush (every 5s) and getting a lot of "Flushing data" logs (in verbose):

2023-08-29 12:27:38748 ExponeaSDK ℹ️ VERBOSE [FlushingManager.swift]:114 flushData(completion:): Flushing data: 0 total objects to upload, 0 events and 0 customer updates.
2023-08-29 12:27:39307 ExponeaSDK ℹ️ VERBOSE [FlushingManager.swift]:114 flushData(completion:): Flushing data: 0 total objects to upload, 0 events and 0 customer updates.
2023-08-29 12:27:40664 ExponeaSDK ℹ️ VERBOSE [FlushingManager.swift]:114 flushData(completion:): Flushing data: 0 total objects to upload, 0 events and 0 customer updates.
2023-08-29 12:27:43747 ExponeaSDK ℹ️ VERBOSE [FlushingManager.swift]:114 flushData(completion:): Flushing data: 0 total objects to upload, 0 events and 0 customer updates.
2023-08-29 12:27:44306 ExponeaSDK ℹ️ VERBOSE [FlushingManager.swift]:114 flushData(completion:): Flushing data: 0 total objects to upload, 0 events and 0 customer updates.
2023-08-29 12:27:45664 ExponeaSDK ℹ️ VERBOSE [FlushingManager.swift]:114 flushData(completion:): Flushing data: 0 total objects to upload, 0 events and 0 customer updates.
2023-08-29 12:27:48746 ExponeaSDK ℹ️ VERBOSE [FlushingManager.swift]:114 flushData(completion:): Flushing data: 0 total objects to upload, 0 events and 0 customer updates.
2023-08-29 12:27:49306 ExponeaSDK ℹ️ VERBOSE [FlushingManager.swift]:114 flushData(completion:): Flushing data: 0 total objects to upload, 0 events and 0 customer updates.
2023-08-29 12:27:50663 ExponeaSDK ℹ️ VERBOSE [FlushingManager.swift]:114 flushData(completion:): Flushing data: 0 total objects to upload, 0 events and 0 customer updates.
2023-08-29 12:27:53747 ExponeaSDK ℹ️ VERBOSE [FlushingManager.swift]:114 flushData(completion:): Flushing data: 0 total objects to upload, 0 events and 0 customer updates.
2023-08-29 12:27:54306 ExponeaSDK ℹ️ VERBOSE [FlushingManager.swift]:114 flushData(completion:): Flushing data: 0 total objects to upload, 0 events and 0 customer updates.
2023-08-29 12:27:55664 ExponeaSDK ℹ️ VERBOSE [FlushingManager.swift]:114 flushData(completion:): Flushing data: 0 total objects to upload, 0 events and 0 customer updates.
2023-08-29 12:27:58746 ExponeaSDK ℹ️ VERBOSE [FlushingManager.swift]:114 flushData(completion:): Flushing data: 0 total objects to upload, 0 events and 0 customer updates.
2023-08-29 12:27:59306 ExponeaSDK ℹ️ VERBOSE [FlushingManager.swift]:114 flushData(completion:): Flushing data: 0 total objects to upload, 0 events and 0 customer updates.
2023-08-29 12:28:00664 ExponeaSDK ℹ️ VERBOSE [FlushingManager.swift]:114 flushData(completion:): Flushing data: 0 total objects to upload, 0 events and 0 customer updates.

This seems related to startPeriodicFlushTimer() not checking if timer is already stopped before restarting a new one.

And the timer is started on applicationDidBecomeActive() but only stopped on applicationDidEnterBackground() which are not symmetrical events (applicationDidEnterForeground is) so at one point there will be multiple timers.

Manual install

Hello, do you have some guide for manual sdk installing?
Is it possible?

Support Xcode 14, iOS 16

Hi, pls fix this for new xcode, thx.
'isElementFullscreenEnabled' is only available in iOS 15.4 or newer
Снимок экрана 2022-09-05 в 12 24 41

Blocking calls on main thread

Hi,

There is an issue #15 which is closed, but from what I see the problem still exists.
I'm using latest version of SDK 2.11.0. And there are some calls being made by Exponea which make UI not responsive for small periods right after app launch. Attaching screenshot with a stack trace.

Is there a way to reduce that influence on the main thread at least at startup?

Auth header Token vs Basic

To be able to use the SDK I had to change the value from here

to request.addValue("Basic \(token)”,

The "Token" does not work while "Basic" works. Didn't need to do it on Android because I could set the value from the config file https://github.com/exponea/exponea-android-sdk/blob/2.7.1/sdk/src/main/java/com/exponea/sdk/network/NetworkHandlerImpl.kt#L34

InAppContentBlock in demo app is not showing

Installed demo app via link from original documentation
https://documentation.bloomreach.com/engagement/docs/ios-sdk-example-app
Xcode Version 15.3 (15E204a)
Min target: 12.0
Destination: iPhone
Testing devices: real device iPhone 11, simulator iPhone 15 Pro, iPhone 15 Pro Max

When running app, on Authentication view entered my project token, API token, and API base URL
Also tried with API Base URL https://api.exponea.com/ (default option)
Went into tab for InAppContentBlocksViewController
I was able to see table view only with numbers, but there were no content blocks
Screenshot and logs in zip files are attached

PS: I have noticed that in documentation there is a screenshot of several view controllers including InAppContent, but content blocks are missed there too.
screenshot from documentation
Screenshot 2024-05-01 at 4 49 20 PM

screenshot from my test
Screenshot 2024-05-01 at 4 45 55 PM

log file
demo app logs.zip

Uploading data to Visual Studio App Center failed

Hi there 👋

I'm currently setting up ExponeaSDK in an app and I get this error in my logging output from time to time. I don't have specific steps to reproduce it but I'm pretty sure it happens as a part of the app launch.

2020-07-22 01:19:36550 ExponeaSDK ❗️ ERROR [VSAppCenterTelemetryUpload.swift]:104 upload(data:completionHandler:): Uploading data to Visual Studio App Center failed.

Error: Optional(Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={_kCFStreamErrorCodeKey=-9816, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSUnderlyingError=0x28334a9a0 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, _kCFNetworkCFStreamSSLErrorOriginalValue=-9816, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9816}}, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://in.appcenter.ms/logs?Api-Version=1.0.0, NSErrorFailingURLStringKey=https://in.appcenter.ms/logs?Api-Version=1.0.0, _kCFStreamErrorDomainKey=3})

Why do I get this error and why does the SDK attempt to share data with Microsoft?

I couldn't find anything in the documentation mentioning this.

It would be really nice if you could provide some more details about this.

Thanks.

InAppContentBlocks doesn't work on iOS

When I was trying to implement InAppContentBlocks I faced up with difficulties.

Installation via CocoaPods: pod "ExponeaSDK", "~> 2.20.0"
Xcode Version 15.0.1 (15A507)
Min target: 13.0
Destination: iPhone
Testing devices: real device iPhone 11, simulator iPhone 15 Pro, iPhone 15 Pro Max

Intro: ExponeaSDK have been successfully installed before and iOS team use it for push notifications and other features.
The problem is exactly with InAppContentBlocks and only on iOS, Android works fine.

Steps for implementation:
I created instances of StaticInAppContentBlockView with both init options (with and without deferredLoad)
Added both BlockView to view using view.addSubview(placeholder), added constraints.
For blockView with deferredLoad I used placeholder.contentReadyCompletion as It was written in docs.
After that, I called reload() for both
But nothing appeared, there wasn't any content in blocks.
I also tried to implement it for tableView, collectionView, WKWebView, add BlocksView to another UIView, show one block at time, show both at the same time - result was the same.

Logs that was received:
placeholder_1 In-app content block has been loaded: true placeholder_1 In-app content block content has size of width 410.0px height 5.0px

I also received this logs:
2023-11-29 11:29:45833 [EXP-iOS] ❗️ ERROR [TelemetryManager.swift]:51 report(eventWithType:properties:): Uploading telemetry event failed. 2023-11-29 11:29:45836 [EXP-iOS] ❗️ ERROR [VSAppCenterTelemetryUpload.swift]:119 upload(data:completionHandler:): Uploading data to Visual Studio App Center failed. Error: Optional(Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x600000dea430 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask <CA05901A-7FFC-471F-9490-F019527B9F2F>.<3>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalUploadTask <CA05901A-7FFC-471F-9490-F019527B9F2F>.<3>" ), NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey=https://in.appcenter.ms/logs?Api-Version=1.0.0, NSErrorFailingURLKey=https://in.appcenter.ms/logs?Api-Version=1.0.0, _kCFStreamErrorDomainKey=4}) Status code: nil Response:

I downloaded demo application from repo, built and run on my test devices - I was able to see sample table view with data but still there wasn't any contentBlockView and an error with TelemetryManager showed continuously.

I will appreciate any advice/suggestions/help in implementation such feature.

didReceiveRemoteNotification trigger in background only for silent notifications

Hello! For the last few days, I've been trying to resolve an issue with notifications.

I found out that when I have the application turned off or in the background, after sending a notification from Exponea, alert will appear, but the didReceiveRemoteNotification method was not called. I also tryied to implement your PushNotificationManagerDelegate with pushNotificationOpened function, but it also gets called only when I open application through notification click. UNUserNotificationCenterDelegate with userNotificationCenter didRecieve method - same scenario..

But today I found out that my didReceiveRemoteNotification was triggered (with app in background), but only when I choose to send the notification as silent. (Silent push notification - Toggle)

Do you have any idea what the connection might be? Or what should I do to be able to process notification event if app is in background/dead.. According to Apple documentation, this should be possible. Thank you.

Tapping a push notification with deeplink triggers deeplink multiple times

I am sending a deeplink to my app via exponeas push notifications, when tapped once, the app will open and handle the link, however it will execute the delegate method several times, leading to a view being presented 3-4 times rather than once.

Executing this code via tapping the deeplink from the notes app rather than an exponea push will execute only once as expected, therefore we propose that perhaps exponea SDK is calling actions more than once when it receives push notifications

Unable to change configuration in runtime

We have a use-case where we'd like to change configuration during runtime, when user changes their permission for behavior tracking.
We're configuring SDK programatically using:

func configure(
        _ projectSettings: ProjectSettings,
        pushNotificationTracking: PushNotificationTracking,
        automaticSessionTracking: AutomaticSessionTracking = .enabled(),
        defaultProperties: [String: JSONConvertible]? = nil,
        flushingSetup: FlushingSetup = FlushingSetup.default
    )

And we'd like to change setting:

pushNotificationTracking: .disabled

After trying to change it in Exponea.shared.configure(...) we're getting an error.
Is there antoher way to do this?

Xcode 12 documentation

It would be a good idea to update your readme so that I don't have to spend time looking for the reason behind commit d0b946a

Improvement - tracking URL with "click" for in-app messages

Currently, click responses for in-app messages are tracking only text of button which was clicked.

For example:
Make button in fullscreen in-app with text "Google", which will redirect user to "https://google.com". When in-app is displayed and user clicks on button, event type "banner" is tracked with action = click, attribute text will be set to "Google". So:
action = click
text = Google
+ other banner attributes...

Request is to track URL https://google.com as well. So final list of attributes:
action = click
text = Google
url = https://google.com
+ other banner attributes...

Unable to update apple_push_notification_id

Tested on:
xcode: Version 15.0 (15A240d)
iPhone: 12 Pro(iOS 17.4)
Exponea:

  • ExponeaSDK (2.21.3):
    • SwiftSoup (= 2.6.1)
  • ExponeaSDK-Notifications (2.21.3)

All things started when a BadDeviceToken error occurred while attempting to send a notification. After fixing the implementation of token refreshing at app start, strange occurrences began to happen. Currently, we register push tokens for users using the following code:

        let customerIds = ["registered" : customerID]
        let properties = [
            "apple_push_notification_id" : token
        ]
        
        Exponea.shared.anonymize()
        Exponea.shared.identifyCustomer(customerIds: customerIds, properties: properties, timestamp: nil)
        Exponea.shared.trackPushToken(token)

During debugging, I noticed that both Exponea.shared.identifyCustomer and Exponea.shared.trackPushToken end up in the same place in your library with a similar stack trace. It seems that both are attempting to achieve the same goal – adding the token for the customer in the Exponea app.

Upon further investigation, we discovered another issue, that seems that it could be connected with Exponea lib. Even after changing the implementation, we still encountered BadDeviceToken errors in some cases. This occurred because there was no change in the Exponea customer database after executing the provided code. Upon reviewing the code, it appears that data about the customer is correctly saved in your DatabaseManager class. However, the customer is only updated with the correct token after killing and restarting the application. The same issue applies to the anonymize function, which does not remove the token from the customer until the application is killed and restarted. Could this be connected with Exponea implementation or we should continue trying to find issue in our code. Could this issue be connected with the Exponea implementation, or should we continue trying to find the issue in our code?

Manual tracking push notification token missing methods from documentation

Documentation says, that you can manually track push notification token:

Manual tracking
You can completely disable notification tracking and use methods Exponea.shared.trackPushToken and Exponea.shared.trackPushOpened to track push notification events. trackPushOpened expects the notification has Exponea format. You can always track campaign event manually with any payload you need.

However trackPushToken method is not visible, because it's for internal usage.

How is it possible to track push notification token manually?

Multiple build issues after upgrading to Xcode 15, Content and Service extensions missing Plist values

My project using the Exponea SDK has run into a lot of problems due to the extensions.

I've worked through several - missing keys in the Info.plist mainly, but now am struggling to get past this:

Asset validation failed
Invalid bundle structure. The “x.app/PlugIns/ContentExtension.appex/ContentExtension” binary file is not permitted. Your app cannot contain standalone executables or libraries, other than a valid CFBundleExecutable of supported bundles. For details, visit: https://developer.apple.com/documentation/bundleresources/placing_content_in_a_bundle (ID: c4d774ab-7203-4dab-9e1d-cfba0e823eae)

For both the ContentExtension and ServiceExtension.

It was difficult to even find out that these were the problem originally because all that happened was that I could not install the app for Ad Hoc testing, but eventually I ended up here.

Perhaps someone else recently resolved this and got further than I have :)

BadDeviceToken on eventlogs

I am encountering a persistent issue when attempting to send push notifications to my iOS device. Every time I try to send a notification, I receive a response with the error comment: "BadDeviceToken" in my event logs.

I have thoroughly checked and confirmed that the device tokens used are correct. I've tried using both production and development (test) environment tokens, ensuring they are properly encoded. Despite these efforts, the issue remains unresolved.

Could you please provide guidance on what might be causing this "BadDeviceToken" error and how to resolve it? Is there a specific format or configuration that I might be missing,

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.