Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit fad5b93

Browse files
[BUG] Reference Error with version 4.2.0 #531
1 parent fec9fe5 commit fad5b93

File tree

4 files changed

+28
-24
lines changed

4 files changed

+28
-24
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
[Firebase Android SDK Changelog](https://firebase.google.com/support/release-notes/android)
55

66

7+
## 4.2.1 (2017, October 24)
8+
9+
### Fixes
10+
- [#531](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/531) [BUG] Reference Error with version 4.2.0
11+
12+
713
## 4.2.0 (2017, October 24)
814

915
### New

demo/references.d.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,2 @@
11
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
2-
/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" />
3-
4-
/// <reference path="../src/platforms/ios/typings/objc!FBSDKCoreKit.d.ts" />
5-
/// <reference path="../src/platforms/ios/typings/objc!FBSDKLoginKit.d.ts" />
6-
/// <reference path="../src/platforms/ios/typings/objc!FirebaseAnalytics.d.ts" />
7-
/// <reference path="../src/platforms/ios/typings/objc!FirebaseAuth.d.ts" />
8-
/// <reference path="../src/platforms/ios/typings/objc!FirebaseCore.d.ts" />
9-
/// <reference path="../src/platforms/ios/typings/objc!FirebaseCrash.d.ts" />
10-
/// <reference path="../src/platforms/ios/typings/objc!FirebaseDatabase.d.ts" />
11-
/// <reference path="../src/platforms/ios/typings/objc!FirebaseDynamicLinks.d.ts" />
12-
/// <reference path="../src/platforms/ios/typings/objc!FirebaseInstanceID.d.ts" />
13-
/// <reference path="../src/platforms/ios/typings/objc!FirebaseInvites.d.ts" />
14-
/// <reference path="../src/platforms/ios/typings/objc!FirebaseMessaging.d.ts" />
15-
/// <reference path="../src/platforms/ios/typings/objc!FirebaseRemoteConfig.d.ts" />
16-
/// <reference path="../src/platforms/ios/typings/objc!FirebaseStorage.d.ts" />
17-
/// <reference path="../src/platforms/ios/typings/objc!GoogleMobileAds.d.ts" />
18-
/// <reference path="../src/platforms/ios/typings/objc!GoogleSignIn.d.ts" />
2+
/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" />

src/firebase.ios.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,6 @@ firebase._registerForRemoteNotifications = function () {
474474
}
475475
};
476476

477-
// TODO test & fix
478477
function getAppDelegate() {
479478
// Play nice with other plugins by not completely ignoring anything already added to the appdelegate
480479
if (application.ios.delegate === undefined) {
@@ -2193,9 +2192,12 @@ firebase.invites.getInvitation = function () {
21932192

21942193
// see https://developer.apple.com/reference/usernotifications/unusernotificationcenterdelegate?language=objc
21952194
class UNUserNotificationCenterDelegateImpl extends NSObject implements UNUserNotificationCenterDelegate {
2196-
public static ObjCProtocols = [UNUserNotificationCenterDelegate];
2195+
public static ObjCProtocols = [];
21972196

21982197
static new(): UNUserNotificationCenterDelegateImpl {
2198+
if (UNUserNotificationCenterDelegateImpl.ObjCProtocols.length === 0 && typeof(UNUserNotificationCenterDelegate) !== "undefined") {
2199+
UNUserNotificationCenterDelegateImpl.ObjCProtocols.push(UNUserNotificationCenterDelegate);
2200+
}
21992201
return <UNUserNotificationCenterDelegateImpl>super.new();
22002202
}
22012203

@@ -2212,9 +2214,12 @@ class UNUserNotificationCenterDelegateImpl extends NSObject implements UNUserNot
22122214
}
22132215

22142216
class FIRInviteDelegateImpl extends NSObject implements FIRInviteDelegate {
2215-
public static ObjCProtocols = [FIRInviteDelegate];
2217+
public static ObjCProtocols = [];
22162218

22172219
static new(): FIRInviteDelegateImpl {
2220+
if (FIRInviteDelegateImpl.ObjCProtocols.length === 0 && typeof(FIRInviteDelegate) !== "undefined") {
2221+
FIRInviteDelegateImpl.ObjCProtocols.push(FIRInviteDelegate);
2222+
}
22182223
return <FIRInviteDelegateImpl>super.new();
22192224
}
22202225

@@ -2231,9 +2236,12 @@ class FIRInviteDelegateImpl extends NSObject implements FIRInviteDelegate {
22312236
}
22322237

22332238
class FIRMessagingDelegateImpl extends NSObject implements FIRMessagingDelegate {
2234-
public static ObjCProtocols = [FIRMessagingDelegate];
2239+
public static ObjCProtocols = [];
22352240

22362241
static new(): FIRMessagingDelegateImpl {
2242+
if (FIRMessagingDelegateImpl.ObjCProtocols.length === 0 && typeof(FIRMessagingDelegate) !== "undefined") {
2243+
FIRMessagingDelegateImpl.ObjCProtocols.push(FIRMessagingDelegate);
2244+
}
22372245
return <FIRMessagingDelegateImpl>super.new();
22382246
}
22392247

@@ -2259,9 +2267,12 @@ class FIRMessagingDelegateImpl extends NSObject implements FIRMessagingDelegate
22592267
}
22602268

22612269
class GADInterstitialDelegateImpl extends NSObject implements GADInterstitialDelegate {
2262-
public static ObjCProtocols = [GADInterstitialDelegate];
2270+
public static ObjCProtocols = [];
22632271

22642272
static new(): GADInterstitialDelegateImpl {
2273+
if (GADInterstitialDelegateImpl.ObjCProtocols.length === 0 && typeof(GADInterstitialDelegate) !== "undefined") {
2274+
GADInterstitialDelegateImpl.ObjCProtocols.push(GADInterstitialDelegate);
2275+
}
22652276
return <GADInterstitialDelegateImpl>super.new();
22662277
}
22672278

@@ -2282,9 +2293,12 @@ class GADInterstitialDelegateImpl extends NSObject implements GADInterstitialDel
22822293
}
22832294

22842295
class GIDSignInDelegateImpl extends NSObject implements GIDSignInDelegate {
2285-
public static ObjCProtocols = [GIDSignInDelegate];
2296+
public static ObjCProtocols = [];
22862297

22872298
static new(): GIDSignInDelegateImpl {
2299+
if (GIDSignInDelegateImpl.ObjCProtocols.length === 0 && typeof(GIDSignInDelegate) !== "undefined") {
2300+
GIDSignInDelegateImpl.ObjCProtocols.push(GIDSignInDelegate);
2301+
}
22882302
return <GIDSignInDelegateImpl>super.new();
22892303
}
22902304

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-plugin-firebase",
3-
"version": "4.2.0",
3+
"version": "4.2.1",
44
"description": "Fire. Base. Firebase!",
55
"main": "firebase",
66
"typings": "index.d.ts",

0 commit comments

Comments
 (0)