Перейти к файлу
Rolf Bjarne Kvinge c7ae591364
[Firebase/Database] Don't link with icucore. (#626)
This avoids a problem where we might accidentally link with private symbols
exported by libicucore.dylib instead of the same symbols provided in a static
library.

This would show up as an App Store rejection:

    TMS-90338: Non-public API usage - The app references non-public symbols:
    _ubrk_openRules, _ucal_add, _ucal_close, _ucal_get, _ucal_getAttribute,
    _ucal_getKeywordValuesForLocale, _ucal_getNow, _ucal_getTimeZoneDisplayName,
    _ucal_getTimeZoneIDForWindowsID, _ucal_getWindowsTimeZoneID, _ucal_open,
    _ucal_openTimeZoneIDEnumeration, _ucal_set, _ucal_setMillis, _ucol_close,
    _ucol_closeElements, _ucol_getOffset, _ucol_getRules, _ucol_getSortKey,
    _ucol_getStrength, _ucol_getVersion, _ucol_next, _ucol_open,
    _ucol_openElements, _ucol_openRules, _ucol_previous, _ucol_safeClone,
    _ucol_setAttribute, _ucol_setVariableTop, _ucol_strcoll, _ucurr_forLocale,
    _ucurr_getName, _udat_close, _udat_countSymbols, _udat_format,
    _udat_getSymbols, _udat_open, _udat_setCalendar, _udat_toPattern,
    _udata_setCommonData, _udatpg_close, _udatpg_getBestPattern, _udatpg_open,
    _uenum_close, _uenum_count, _uenum_next, _uldn_close,
    _uldn_keyValueDisplayName, _uldn_open, _uloc_canonicalize,
    _uloc_countAvailable, _uloc_getAvailable, _uloc_getBaseName,
    _uloc_getCharacterOrientation, _uloc_getCountry, _uloc_getDefault,
    _uloc_getDisplayCountry, _uloc_getDisplayLanguage, _uloc_getDisplayName,
    _uloc_getISO3Country, _uloc_getISO3Language, _uloc_getKeywordValue,
    _uloc_getLCID, _uloc_getLanguage, _uloc_getName, _uloc_getParent,
    _uloc_setKeywordValue, _ulocdata_getCLDRVersion,
    _ulocdata_getMeasurementSystem, _unorm2_getNFDInstance,
    _unorm2_getNFKCInstance, _unorm2_getNFKDInstance, _unorm2_isNormalized,
    _unum_close, _unum_getAttribute, _unum_getSymbol, _unum_open, _unum_toPattern,
    _ures_close, _ures_getByKey, _ures_getSize, _ures_getStringByIndex,
    _ures_open, _usearch_close, _usearch_first, _usearch_getBreakIterator,
    _usearch_getMatchedLength, _usearch_last, _usearch_openFromCollator,
    _usearch_setPattern, _usearch_setText.

This is what happens:

1. Mono uses ICU for various purposes, and we ship the corresponding helper
   code as a static library (libicui18n.a).
2. iOS also uses ICU, and does so privately, we have no access to iOS’ copy of
   those libraries.
3. FirebaseDatabase links with libicucore.dylib (this is a dylib shipped in
   iOS). I’m not exactly sure why FirebaseDatabase does this, but it seems to
   be allowed by Apple.
4. libicucore.dylib exports some of the symbols from iOS’ (private) copy of
   ICU. I’m assuming this is just an implementation detail on Apple’s side,
   and why they’ve added checks to the App Store to reject any apps that
   reference these private symbols. When using FirebaseDatabase, we end up
   asking the native linker to link with libicucore.dylib (-licucore) due to
   the LinkerFlags in the NativeReference item.
5. We already ask the native linker to link with our own static version of ICU
   (from step 1) – by passing the path to the static library in question
   (libicui18n.a)
6. Depending on which native linker argument comes first (-licucore or
   libicui18n.a) the native linker will find the symbols in one place or the
   other. If found in Apple’s libicucore.dylib, the app ends up rejected by
   the App Store.

So avoid all of this by making FirebaseDatabase not link with
libicucore.dylib.
2023-08-29 09:41:26 -04:00
.ci [ci] Removed no longer used step in build.yml 2023-02-04 01:11:30 -06:00
deprecated Deleting service-account.json 2023-02-04 00:15:39 -06:00
docs Remove unused keys 2021-10-29 10:06:00 -04:00
icons [MLKit] Fixed NuGet icons 2022-02-01 20:32:50 -06:00
samples Bumped XBD version to 0.11.1 2022-04-18 12:46:04 -05:00
source [Firebase/Database] Don't link with icucore. (#626) 2023-08-29 09:41:26 -04:00
.editorconfig Added an .editorconfig to Solution 2020-04-30 14:25:08 -05:00
.gitignore Start ignoring GoogleService-Info file to avoid exposing API keys 2022-02-01 20:32:50 -06:00
Directory.Build.props Added global props and config 2022-04-18 12:46:04 -05:00
License.md Updates for .NET Foundation. 2016-04-27 00:03:57 -04:00
Readme.md updated GoogleMaps 6.0.1 2022-01-17 07:44:55 +10:30
SignList.xml Update signing to v2 (#451) 2020-11-07 00:42:08 +02:00
Xamarin.Google.NuGet.Legacy.sln [samples] Renamed samples using MonoTouch.Dialog as Legacy as it's not available for .net6.0 2022-04-18 12:46:04 -05:00
Xamarin.Google.NuGet.sln Updated Xamarin.Google.NuGet solution 2022-04-18 12:46:04 -05:00
Xamarin.Google.sln Added some changes 2022-04-18 12:46:04 -05:00
azure-pipelines-compliance.yml Restore the azure-pipelines-compliance.yml 2023-02-03 18:07:56 -06:00
azure-pipelines.yml [ci] Import build.yml from XamarinComponents (#601) 2023-02-03 15:34:33 -05:00
build.cake Samples are now built with dotnet in build.cake 2022-04-18 12:46:04 -05:00
cgmanifest.json Updated cgmanifest.json file 2022-05-17 13:07:59 -05:00
common.cake Cake now builds xcframeworks 2022-04-18 12:46:04 -05:00
components.cake [Firebase/Google] Build frameworks using Xcode 14 2022-11-05 15:17:19 -06:00
custom_externals_download.cake [Firebase][Core] Updated to version 6.1.0 (Firebase v6.5.0) 2019-09-27 23:43:51 -05:00
global.json [ci] Bumped dotnet version to 6.0.402 and Xcode to 14.0.0 2022-11-05 15:17:19 -06:00
manifest.yaml Rename module from ‘Functions’ to ‘CloudFunctions’ 2020-04-05 15:45:44 +02:00
poco.cake Adding code to build xcframeworks 2022-04-18 12:46:04 -05:00
update.cake Moved samples using NuGets to its own Solution 2022-02-02 14:55:36 -06:00

Readme.md

Xamarin Components for Google APIs for iOS

Xamarin creates and maintains Xamarin.iOS bindings for the Google APIs for iOS Libraries, including:

Active Libraries

Package Id NuGet
Xamarin.Firebase.iOS.ABTesting 8.10.0
Xamarin.Firebase.iOS.AdMob 8.10.0.0
Xamarin.Firebase.iOS.Analytics 8.10.0
Xamarin.Firebase.iOS.Auth 8.10.0
Xamarin.Firebase.iOS.CloudFirestore 8.10.0
Xamarin.Firebase.iOS.CloudFunctions 8.10.0
Xamarin.Firebase.iOS.CloudMessaging 8.10.0
Xamarin.Firebase.iOS.Core 8.10.0
Xamarin.Firebase.iOS.Crashlytics 8.10.0
Xamarin.Firebase.iOS.Database 8.10.0
Xamarin.Firebase.iOS.DynamicLinks 8.10.0
Xamarin.Firebase.iOS.InAppMessaging 8.10.0
Xamarin.Firebase.iOS.Installations 8.10.0
Xamarin.Firebase.iOS.PerformanceMonitoring 8.10.0
Xamarin.Firebase.iOS.RemoteConfig 8.10.0
Xamarin.Firebase.iOS.Storage 8.10.0
Xamarin.Google.iOS.Analytics 3.20.0.0
Xamarin.Google.iOS.Cast 4.7.0.0
Xamarin.Google.iOS.Maps 6.0.1.0
Xamarin.Google.iOS.MobileAds 8.13.0.0
Xamarin.Google.iOS.UserMessagingPlatform 1.1.0.0
Xamarin.Google.iOS.Places 6.0.0.0
Xamarin.Google.iOS.SignIn 5.0.2.2
Xamarin.Google.iOS.TagManager 7.4.0.0

Deprecated Libraries

Package Id NuGet
Xamarin.Firebase.iOS.InstanceID 7.11.0.0
Xamarin.Google.iOS.AppIndexing 2.0.3.8
Xamarin.Google.iOS.InstanceID 1.2.1.18
Xamarin.Google.iOS.PlayGames 5.1.1.11
Xamarin.Firebase.iOS.CrashReporting 2.0.0.6
Xamarin.Firebase.iOS.Invites 3.0.1.1
Xamarin.Google.iOS.AppInvite 1.0.2.4
Xamarin.Google.iOS.Core 3.1.0.1
Xamarin.Google.iOS.GoogleCloudMessaging 1.2.0.1
Xamarin.Firebase.iOS.MLKit 0.21.0.0
Xamarin.Firebase.iOS.MLKit.Common 0.21.0.0
Xamarin.Firebase.iOS.MLKit.ModelInterpreter 0.21.0.0
Xamarin.Firebase.iOS.MLKit.NaturalLanguage 0.18.1.0
Xamarin.Firebase.iOS.MLKit.Vision 0.21.0.0

Firebase APIs for iOS current global version

Here's a table that shows in which global version is located each component of Firebase at this point of history:

Component Name Component Version Global Version
Firebase A/B Testing 8.10.0 8.10.0
Firebase AdMob 8.10.0 8.10.0
Firebase Analytics 8.10.0 8.10.0
Firebase Auth 8.10.0 8.10.0
Firebase Cloud Firestore 8.10.0 8.10.0
Firebase Cloud Functions 8.10.0 8.10.0
Firebase Cloud Messaging 8.10.0 8.10.0
Firebase Core 8.10.0 8.10.0
Firebase Crashlytics 8.10.0 8.10.0
Firebase Database 8.10.0 8.10.0
Firebase Dynamic Links 8.10.0 8.10.0
Firebase In App Messaging 8.10.0 8.10.0
Firebase Installations 8.10.0 8.10.0
Firebase Performance Monitoring 8.10.0 8.10.0
Firebase RemoteConfig 8.10.0 8.10.0
Firebase Storage 8.10.0 8.10.0
Google User Messaging Platform 1.1.0.0 8.10.0
Google Cast 4.7.0.0 8.10.0
Google Sign-In 5.0.2.2 8.10.0
Google Tag Manager 7.4.0.0 8.10.0

Ad Id Support

By default Firebase includes Ad Id Support, however, it can be disabled by adding the below property group to your project file.

<PropertyGroup>
  <FirebaseWithoutAdIdSupport>True</FirebaseWithoutAdIdSupport>
</PropertyGroup>

Building

Prerequisites

Before building the libraries and samples in this repository, you will need to install .NET Core and the Cake .NET Core Tool:

Currently requires a version of Cake less than 1.0 (due to dependencies).

dotnet tool install -g cake.tool --version 0.38.5

When building on macOS, you may also need to install CocoaPods:

# Homebrew
brew install cocoapods

# Ruby Gems
gem install cocoapods

Compiling

You can either build all the libraries and samples in the repository from the root:

dotnet cake

Or, you can specify the components and its dependencies to be build by using the --names=Key1,Key2,...:

// Firebase keys
Firebase.ABTesting
Firebase.AdMob
Firebase.Analytics
Firebase.Auth
Firebase.CloudFirestore
Firebase.CloudFunctions
Firebase.CloudMessaging
Firebase.Core
Firebase.Crashlytics
Firebase.Database
Firebase.DynamicLinks
Firebase.InAppMessaging
Firebase.Installations
Firebase.PerformanceMonitoring
Firebase.RemoteConfig
Firebase.Storage

// Google keys
Google.Analytics
Google.Cast
Google.Maps
Google.MobileAds
Google.UserMessagingPlatform
Google.Places
Google.SignIn
Google.TagManager

// MLKit keys
MLKit.BarcodeScanning
MLKit.Core
MLKit.DigitalInkRecognition
MLKit.FaceDetection
MLKit.ImageLabeling
MLKit.ObjectDetection
MLKit.TextRecognition
MLKit.TextRecognition.Chinese
MLKit.TextRecognition.Devanagari
MLKit.TextRecognition.Japanese
MLKit.TextRecognition.Korean
MLKit.TextRecognition.Latin
MLKit.Vision

The following targets can be specified using the --target=<target-name>:

  • libs builds the class library bindings (depends on externals)
  • externals downloads and builds the external dependencies
  • samples builds all of the samples (depends on libs)
  • nuget builds the nuget packages (depends on libs)
  • clean cleans up everything

Working in Visual Studio

Before the .sln files will compile in the IDEs, the external dependencies need to be downloaded. This can be done by running the externals target:

dotnet cake --target=externals

After the externals are downloaded and built, the .sln files should compile in your IDE.

License

The license for this repository is specified in License.md

Contribution Guidelines

You will need to complete a Contribution License Agreement before your pull request can be accepted. You can complete the CLA by going through the steps at https://cla2.dotnetfoundation.org/.

.NET Foundation

This project is part of the .NET Foundation