-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into maddylewis-patch-4
- Loading branch information
Showing
174 changed files
with
3,775 additions
and
1,312 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import type {AirshipContact, AirshipPush, AirshipPushAndroid, AirshipPushIOS, AirshipRoot} from '@ua/react-native-airship'; | ||
import {EventType as AirshipEventType, iOS as AirshipIOS} from '@ua/react-native-airship'; | ||
|
||
const EventType: Partial<typeof AirshipEventType> = { | ||
NotificationResponse: AirshipEventType.NotificationResponse, | ||
PushReceived: AirshipEventType.PushReceived, | ||
}; | ||
|
||
const iOS: Partial<typeof AirshipIOS> = { | ||
ForegroundPresentationOption: { | ||
Sound: AirshipIOS.ForegroundPresentationOption.Sound, | ||
Badge: AirshipIOS.ForegroundPresentationOption.Badge, | ||
Banner: AirshipIOS.ForegroundPresentationOption.Banner, | ||
List: AirshipIOS.ForegroundPresentationOption.List, | ||
}, | ||
}; | ||
|
||
const pushIOS: AirshipPushIOS = jest.fn().mockImplementation(() => ({ | ||
setBadgeNumber: jest.fn(), | ||
setForegroundPresentationOptions: jest.fn(), | ||
setForegroundPresentationOptionsCallback: jest.fn(), | ||
}))(); | ||
|
||
const pushAndroid: AirshipPushAndroid = jest.fn().mockImplementation(() => ({ | ||
setForegroundDisplayPredicate: jest.fn(), | ||
}))(); | ||
|
||
const push: AirshipPush = jest.fn().mockImplementation(() => ({ | ||
iOS: pushIOS, | ||
android: pushAndroid, | ||
enableUserNotifications: () => Promise.resolve(false), | ||
clearNotifications: jest.fn(), | ||
getNotificationStatus: () => Promise.resolve({airshipOptIn: false, systemEnabled: false, airshipEnabled: false}), | ||
getActiveNotifications: () => Promise.resolve([]), | ||
}))(); | ||
|
||
const contact: AirshipContact = jest.fn().mockImplementation(() => ({ | ||
identify: jest.fn(), | ||
getNamedUserId: () => Promise.resolve(undefined), | ||
reset: jest.fn(), | ||
module: jest.fn(), | ||
}))(); | ||
|
||
const Airship: Partial<AirshipRoot> = { | ||
addListener: jest.fn(), | ||
removeAllListeners: jest.fn(), | ||
push, | ||
contact, | ||
}; | ||
|
||
export default Airship; | ||
|
||
export {EventType, iOS}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.