Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using reflection for iOS 13 API writeData:error: #1030

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

emawby
Copy link
Contributor

@emawby emawby commented Dec 14, 2021

Description

One Line Summary

Using reflection for the iOS 13+ writeData:error: api introduced in pr #1029.

Details

Our build scripts still require Xcode 10 which is not aware of iOS 13+ APIs. PR #1029 added an iOS 13 API, but did not use reflection for it resulting in build failure when trying to release a new binary.
We need to use NSInvocation for reflection because performSelector cannot take pointer parameters.

Motivation

This PR fixes using an iOS 13 api without reflection which caused build failure for the build_fat_framework.sh script.
This issue was introduced by pr #1029

Testing

Manual testing

I tested both success and failure on an iOS 15 device. The error had a proper description and when successful the image appeared in the notification.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes
  • Distribution

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

This change is Reviewable

We need to use NSInvocation for reflection because performSelector cannot take pointer parameters.
Copy link
Member

@jkasten2 jkasten2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @emawby)

@emawby emawby merged commit f447eba into main Dec 14, 2021
@emawby emawby deleted the fix/use_reflection_for_attachment_download branch December 14, 2021 23:45
@emawby emawby mentioned this pull request Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants