Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/ios-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,18 @@ jobs:
timeout-minutes: 45
# Exercises both CocoaPods and SPM in a single Xcode project. Catches
# regressions in either dependency manager (each pathway runs end to end)
# and additionally validates that they coexist correctly.
# and additionally validates that they coexist correctly. Also turns on
# Google sign-in so GoogleConnectImpl.m is compiled under Xcode -- catches
# signature drift between hand-written iOS port .m files and the
# ParparVM-generated `set_field_*` headers, which is otherwise invisible
# until a customer enables Google sign-in.
env:
IOS_DEPENDENCY_ARGS: >-
-Dcodename1.arg.ios.dependencyManager=both
-Dcodename1.arg.ios.pods=AFNetworking
-Dcodename1.arg.ios.spm.packages=swift-collections|https://github.com/apple/swift-collections.git|from:1.1.0
-Dcodename1.arg.ios.spm.products.swift-collections=Collections
-Dcodename1.arg.ios.gplus.clientId=000000000000-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.apps.googleusercontent.com

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions Ports/iOSPort/nativeSources/FacebookImpl.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ void com_codename1_impl_ios_IOSNative_facebookLogin___java_lang_Object(CN1_THREA
if (result.isCancelled) {
// Handle cancellations
#ifdef NEW_CODENAME_ONE_VM
set_field_com_codename1_social_FacebookImpl_loginCancelled(threadStateData, JAVA_TRUE, instance);
set_field_com_codename1_social_FacebookImpl_loginCancelled(JAVA_TRUE, instance);
#else
com_codename1_social_FacebookImpl* impl = (com_codename1_social_FacebookImpl*)instance;
impl->fields.com_codename1_social_FacebookImpl.loginCancelled_ = TRUE;
#endif
} else {
#ifdef NEW_CODENAME_ONE_VM
set_field_com_codename1_social_FacebookImpl_loginCompleted(threadStateData, JAVA_TRUE, instance);
set_field_com_codename1_social_FacebookImpl_loginCompleted(JAVA_TRUE, instance);
#else
com_codename1_social_FacebookImpl* impl = (com_codename1_social_FacebookImpl*)instance;
#endif
Expand Down
20 changes: 10 additions & 10 deletions Ports/iOSPort/nativeSources/GoogleConnectImpl.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ void com_codename1_impl_ios_IOSNative_googleLogin___java_lang_Object(CN1_THREAD_
JAVA_OBJECT d = com_codename1_ui_Display_getInstance__(CN1_THREAD_GET_STATE_PASS_SINGLE_ARG);
JAVA_OBJECT jClientID = virtual_com_codename1_ui_Display_getProperty___java_lang_String_java_lang_String_R_java_lang_String(CN1_THREAD_STATE_PASS_ARG d, fromNSString(CN1_THREAD_STATE_PASS_ARG @"ios.gplus.clientId"), JAVA_NULL);
if (jClientID == JAVA_NULL) {
set_field_com_codename1_social_GoogleImpl_loginMessage(CN1_THREAD_GET_STATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG @"Failed to log in due to a configuration error."), googleLoginCallback);
set_field_com_codename1_social_GoogleImpl_loginCompleted(CN1_THREAD_GET_STATE_PASS_ARG JAVA_TRUE, googleLoginCallback);
set_field_com_codename1_social_GoogleImpl_loginMessage(fromNSString(CN1_THREAD_GET_STATE_PASS_ARG @"Failed to log in due to a configuration error."), googleLoginCallback);
set_field_com_codename1_social_GoogleImpl_loginCompleted(JAVA_TRUE, googleLoginCallback);
googleLoginCallback = NULL;
CN1Log(@"Could not login to Google Plus because 'ios.gplus.clientId' property is not set. Ensure that the ios.gplus.clientId build hint is set");
return;
Expand All @@ -88,8 +88,8 @@ void com_codename1_impl_ios_IOSNative_googleLogin___java_lang_Object(CN1_THREAD_
BOOL isGooglePlusInstalled = [[UIApplication sharedApplication] canOpenURL: [NSURL
URLWithString:@"gplus://"]];
if (!isGooglePlusInstalled) {
set_field_com_codename1_social_GoogleImpl_loginMessage(CN1_THREAD_GET_STATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG @"Please install the Google Plus app on your device in order to log in with Google Plus."), googleLoginCallback);
set_field_com_codename1_social_GoogleImpl_loginCompleted(CN1_THREAD_GET_STATE_PASS_ARG JAVA_TRUE, googleLoginCallback);
set_field_com_codename1_social_GoogleImpl_loginMessage(fromNSString(CN1_THREAD_GET_STATE_PASS_ARG @"Please install the Google Plus app on your device in order to log in with Google Plus."), googleLoginCallback);
set_field_com_codename1_social_GoogleImpl_loginCompleted(JAVA_TRUE, googleLoginCallback);
googleLoginCallback = NULL;
CN1Log(@"Could not log into Google plus because the Google Plus app isn't installed and the ios.gplus.requireGplusAppForLogin property is set to true. This limitation is to work around Apple app store rejections caused by logging in with Safari");
return;
Expand Down Expand Up @@ -127,11 +127,11 @@ void com_codename1_impl_ios_GoogleConnectImpl_finishedWithAuth(GTMOAuth2Authenti

if (googleLoginCallback != NULL) {
if (error != nil) {
set_field_com_codename1_social_GoogleImpl_loginMessage(CN1_THREAD_GET_STATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG [error localizedDescription]), googleLoginCallback);
set_field_com_codename1_social_GoogleImpl_loginMessage(fromNSString(CN1_THREAD_GET_STATE_PASS_ARG [error localizedDescription]), googleLoginCallback);
} else {
set_field_com_codename1_social_GoogleImpl_loginMessage(CN1_THREAD_GET_STATE_PASS_ARG JAVA_NULL, googleLoginCallback);
set_field_com_codename1_social_GoogleImpl_loginMessage(JAVA_NULL, googleLoginCallback);
}
set_field_com_codename1_social_GoogleImpl_loginCompleted(CN1_THREAD_GET_STATE_PASS_ARG JAVA_TRUE, googleLoginCallback);
set_field_com_codename1_social_GoogleImpl_loginCompleted(JAVA_TRUE, googleLoginCallback);
googleLoginCallback = NULL;
}

Expand All @@ -152,11 +152,11 @@ void com_codename1_impl_ios_GoogleConnectImpl_finishedWithAuth(GIDGoogleUser *us

if (googleLoginCallback != NULL) {
if (error != nil) {
set_field_com_codename1_social_GoogleImpl_loginMessage(CN1_THREAD_GET_STATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG [error localizedDescription]), googleLoginCallback);
set_field_com_codename1_social_GoogleImpl_loginMessage(fromNSString(CN1_THREAD_GET_STATE_PASS_ARG [error localizedDescription]), googleLoginCallback);
} else {
set_field_com_codename1_social_GoogleImpl_loginMessage(CN1_THREAD_GET_STATE_PASS_ARG JAVA_NULL, googleLoginCallback);
set_field_com_codename1_social_GoogleImpl_loginMessage(JAVA_NULL, googleLoginCallback);
}
set_field_com_codename1_social_GoogleImpl_loginCompleted(CN1_THREAD_GET_STATE_PASS_ARG JAVA_TRUE, googleLoginCallback);
set_field_com_codename1_social_GoogleImpl_loginCompleted(JAVA_TRUE, googleLoginCallback);
googleLoginCallback = NULL;
}

Expand Down
Loading