Skip to content

[Bug]: LiveActivities.end Not Working in iOS SDK and React Native SDK #1572

Open
@Sun-Woo-Kim

Description

@Sun-Woo-Kim

What happened?

Dear OneSignal Team,

Hello. I am trying to use Live Activity in React Native. However, the methods OneSignal.LiveActivities.enter and OneSignal.LiveActivities.end do not work for me—only OneSignal.LiveActivities.startDefault(activityId, attributes, content) functions properly. Despite that, I still cannot end the Live Activity.

I have tested with direct API calls, on a physical device, and even set up a 10-second timer to end the activity, but all attempts have failed. Thinking there might be an issue in the React Native SDK, I tried running the example app, but the iOS app included in the example files did not run.

While investigating further, I discovered the iOS sample app here:
https://github.com/OneSignalDevelopers/onesignal-ios-sample

When I run Live Activity and then try to end it in this sample, the exact same problem occurs. Therefore, I am reporting this issue. Please let me know how to properly end a Live Activity.

Thank you.

_talkv_wxP6iCum0z_3khmwuoRLIdmwR7J7UWxd1_talkv_high.MP4

Steps to reproduce?

I downloaded and ran the iOS sample app from the OneSignal repository (https://github.com/OneSignalDevelopers/onesignal-ios-sample) to reproduce this problem. However, when I start a Live Activity and then attempt to end it, the activity never closes. I have attached a video demonstrating the exact reproduction steps.

What did you expect to happen?

I expected that after calling OneSignal.LiveActivities.exit(activityId), the Live Activity would immediately close and be removed from the Lock Screen (or Dynamic Island). In other words, invoking the “exit” method should terminate the activity rather than leaving it running indefinitely.

OneSignal iOS SDK version

5.2.1

iOS version

18

Specific iOS version

iOS 18.2

Relevant log output

DEBUG: OSChannelTracker for: notification_id lastChannelObjectReceived: (null)
DEBUG: OSChannelTracker for: iam_id lastChannelObjectReceived: (null)
DEBUG: Trackers after update attempt: (
    "OSChannelTracker tag: notification_id influenceType: UNATTRIBUTED indirectIds: (null) directIds: (null)",
    "OSChannelTracker tag: iam_id influenceType: UNATTRIBUTED indirectIds: (null) directIds: (null)"
)
DEBUG: OneSignal SessionManager sendSessionEndingWithInfluences with influences: (
)
VERBOSE: OneSignal.LiveActivities leave called with activityId: live_activity_id
VERBOSE: OneSignal.LiveActivities saving token cache OneSignalLiveActivities.UpdateRequestCache: ["live_activity_id": (OSRequestRemoveUpdateToken) key:live_activity_id requestSuccessful:false]
VERBOSE: OneSignal.LiveActivities executing request: (OSRequestRemoveUpdateToken) key:live_activity_id requestSuccessful:false
VERBOSE: network response (OneSignalLiveActivities.OSRequestRemoveUpdateToken) with URL https://api.onesignal.com/apps/202d4f61-1ca9-42df-9d36-bb17d8613abf/live_activities/live_activity_id/token/14808135-190e-4f90-83c5-6478ecaeb22f: {
    errors =     (
        "API rate limit exceeded"
    );
    httpStatusCode = 429;
    limit = "API Per App";
}
VERBOSE: OneSignal.LiveActivities request failed with error Optional(Error Domain=OneSignalError Code=429 "(null)" UserInfo={returned={
    errors =     (
        "API rate limit exceeded"
    );
    httpStatusCode = 429;
    limit = "API Per App";
}})
VERBOSE: OneSignal.LiveActivities setStartToken called with activityType: LiveActivityAttributes token: 808594b574f00edf956bde024ac29d90dd39fb2453525410d02d1e82a6d0a5995cba98cf5dd63b27d7ba927afab3a4b0adbe929053634386c41c52de799e075c5d83cbb2c74ae730bf6abd38158c06fca677dc647ca7e1634789a52a895f5f5f62cb93b67ad2d8fd3f53ad15ce2b77be147498a9cf75f86f03f8b1b9adf5ba07
VERBOSE: OneSignal.LiveActivities superseded request not saved/executed: (OSRequestSetStartToken) key:LiveActivityAttributes requestSuccessful:false token:808594b574f00edf956bde024ac29d90dd39fb2453525410d02d1e82a6d0a5995cba98cf5dd63b27d7ba927afab3a4b0adbe929053634386c41c52de799e075c5d83cbb2c74ae730bf6abd38158c06fca677dc647ca7e1634789a52a895f5f5f62cb93b67ad2d8fd3f53ad15ce2b77be147498a9cf75f86f03f8b1b9adf5ba07
Live Activity Push Token:  804d7cb53df3e1bbc9c3409d83ecd6a4395a0efe28f99b23182234ba564dd48f61cba8a980b061d5fe4660fa69a6edfc89b30134748819534ad8829d12ae7fb7715008c8729b9ea9677074fd87c585ca93200753140da89ac26e226a63f502b47fb16b50fdf4733799e3a8025cdd8716a67addc8e28282afa1058ffb07e3ef45
VERBOSE: OneSignal.LiveActivities enter called with activityId: live_activity_id token: 804d7cb53df3e1bbc9c3409d83ecd6a4395a0efe28f99b23182234ba564dd48f61cba8a980b061d5fe4660fa69a6edfc89b30134748819534ad8829d12ae7fb7715008c8729b9ea9677074fd87c585ca93200753140da89ac26e226a63f502b47fb16b50fdf4733799e3a8025cdd8716a67addc8e28282afa1058ffb07e3ef45
VERBOSE: OneSignal.LiveActivities saving token cache OneSignalLiveActivities.UpdateRequestCache: ["live_activity_id": (OSRequestSetUpdateToken) key:live_activity_id requestSuccessful:false token:804d7cb53df3e1bbc9c3409d83ecd6a4395a0efe28f99b23182234ba564dd48f61cba8a980b061d5fe4660fa69a6edfc89b30134748819534ad8829d12ae7fb7715008c8729b9ea9677074fd87c585ca93200753140da89ac26e226a63f502b47fb16b50fdf4733799e3a8025cdd8716a67addc8e28282afa1058ffb07e3ef45]
VERBOSE: OneSignal.LiveActivities executing request: (OSRequestSetUpdateToken) key:live_activity_id requestSuccessful:false

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions