amplitude / amplitude/Amplitude-iOS

Failed to send events in widget extension

Aperta
#468 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug feature request
Lingua principale
Objective-C
Stelle
328
Fork
194
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hello,
I have an issue with sending events from widget extension.
I've tried following options:

1. Updated to the latest version of SDK (from v4.10.0 to v8.17.2)
2. Force events sending with `Amplitude.instance(withName: "widgets").uploadEvents()`
3. Send events with API (batch operation) and wait for response before returning timeline in `Provider.getTimeline(...)`
4. Also I've tried to use the newest SDK for Amplitude: Amplitude-Swift v1.1.0 -- it isn't support to be used in app extensions

Appreciate any help or advice

## Expected Behavior

Event should be sent via SDK

## Current Behavior

Getting error in console while SDK tries to send event:
`ERROR: Connection error:Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={_kCFStreamErrorCodeKey=57, NSUnderlyingError=0x147f0bf50 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorCodeKey=57, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask .<1>"
), NSLocalizedDescription=The network connection was lost., NSErrorFailingURLStringKey=https://api.amplitude.com/, NSErrorFailingURLKey=https://api.amplitude.com/, _kCFStreamErrorDomainKey=1}
`

Or with API calls:

`Task <5EF7A32F-D407-41BE-A8E4-B38A9CC8A9A0>.<1> finished with error [18 446 744 073 709 550 619] Error Domain=NSURLErrorDomain Code=-997 UserInfo={NSErrorFailingURLStringKey=, NSErrorFailingURLKey=, _NSURLErrorRelatedURLSessionTaskErrorKey=, _NSURLErrorFailingURLSessionTaskErrorKey=, NSLocalizedDescription=}`

I have to mention that network conditions is actually fine and events can be successfully sent from application, but widget extension.

## Possible Solution

## Steps to Reproduce

1. Install application
2. Kill application (in order to run only widget extension process)
5. Add widget (event is triggered on getting timeline)

## Environment
- SDK Version: v8.17.2, v4.10.0
- Device: iPhone 14 pro
- OS Version: iOS 17.0.2

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.