feat(ios): LibIOS binding layer (226 funs) + push notifications landed - #60
Open
zendrx wants to merge 1 commit into
Open
feat(ios): LibIOS binding layer (226 funs) + push notifications landed#60zendrx wants to merge 1 commit into
zendrx wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
1. LibIOS — the iOS binding layer (
src/native/engine/ios/ios_bindings.cr) — the headlineThe framework's iOS branches reference
LibIOS.*225 distinct functions across ~25 files — and none of them were ever written. This PR writes the completelib LibIOSC-ABI contract:Void*handles, string getters return borrowedUInt8*released viafree_string/free_string_array/free, colors are normalizedFloat32components, music time isFloat64, sensor/battery/etc. per its usage.platform#sharecalledsharewith 2 args whileshare.cruses the 6-arg form — platform now passes NULL for absent fields).libnative_iosdylib can be implemented directly against it.String#to_utf8(the iOS branches' string convention) in the same file.2. Push notifications (from the interrupted session)
push_notification.c_rfrom the repo root moved to its rightful placesrc/native/framework/push_notifications.crand fixed: null-checked method ids, class-ref cleanup, newhandle_token_refresh/on_token_refresh, exception-safe user callbacks (an app exception can no longer unwind through the JNI boundary).PushManager/FcmServicenow post every native callback to the main thread viaHandler(Looper.getMainLooper())— FCM/GMS executor threads were calling into the thread-bound cachedJNIEnv(UB). Dead reflection listener removed; null tokens no longer cross JNI.src/native.cr+require "log"; desktop-path spec coverage added (spec/push_notification_spec.cr); Changelog has an Unreleased section.3. Note on CI (owner is checking personally — probe step removed)
While auditing I found the platform typecheck jobs pass despite 239→225
LibIOSreferences existing with no definition — meaning-Dnative_ios/-Dnative_androidare likely not activating theflag?(:…)branches and the jobs are desktop compiles in disguise. A temporary probe step was added to ci.yml and is removed in this PR per owner decision. Once this PR merges, a good manual check is:crystal eval -Dnative_ios 'puts {{ flag?(:native_ios) }}'— if that printsfalse, the-Dhandling in the installed toolchain needs a look before the iOS branches can be considered genuinely type-checked.🤖 Co-authored with the repo owner's in-flight batch work.