Skip to content

Commit 5ec02bf

Browse files
authored
fix: add missing button title (#83)
* fix: add missing button title * chore: remove commented code and update example podfile.lock * fix: add button title prop to config * docs: add mandatory props to config in readme * chore: update example app with button title * docs: add screenshots to readme * fix: update live activity dependency * chore: update boilerplate version
1 parent ccea551 commit 5ec02bf

File tree

12 files changed

+27
-63
lines changed

12 files changed

+27
-63
lines changed

.boilerplate-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7bfa4c6f01092c31872ed8636f0c2953909d65b0
1+
e6bdb64df32660638bc0fafbfec97f6365a03b63

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
A package for creating iOS Live Activity notification with simple countdown
44

5+
![Image 1](images/1.png)
6+
![Image 2](images/2.png)
7+
![Image 3](images/3.png)
8+
59
## Installation
610

711
### Install the package and pods
@@ -47,6 +51,8 @@ import { createLiveActivity } from '@txo/live-activity-countdown-react-native';
4751

4852
createLiveActivity({
4953
title: 'Test title',
54+
timerTitle: 'Remaining time',
55+
buttonTitle: 'Open App',
5056
endDateTime: '2022-12-31T12:00:00.000Z', // Date object can be used too
5157
timerColor: '#cccccc',
5258
})

example/ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,4 +587,4 @@ SPEC CHECKSUMS:
587587

588588
PODFILE CHECKSUM: 46221d50be89e475baac86cad929aceb284a2dd2
589589

590-
COCOAPODS: 1.11.3
590+
COCOAPODS: 1.12.1

example/src/App.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ export default function App (): JSX.Element {
1818
const onStartLiveActivityPress = useCallback(() => {
1919
if (isNotEmptyString(activityId)) return
2020
void createLiveActivity({
21-
title: 'test title',
22-
timerTitle: 'Time to unlock',
21+
title: 'Test title',
22+
timerTitle: 'Remaining time',
23+
buttonTitle: 'Open App',
2324
endDateTime: new Date(Date.now() + 90 * 60 * 1000),
2425
timerColor: '#61dafb',
2526
}).then((id) => {

images/1.png

137 KB
Loading

images/2.png

602 KB
Loading

images/3.png

185 KB
Loading

ios/LiveActivityCountdown.m

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#import <React/RCTBridgeModule.h>
2-
//#import "LiveActivityCountdown-Swift.h"
32

43
@interface RCT_EXTERN_MODULE(LiveActivityCountdown, NSObject)
54

@@ -20,55 +19,3 @@ + (BOOL)requiresMainQueueSetup
2019
}
2120

2221
@end
23-
24-
//@interface LiveActivityCountdownReg : NSObject
25-
//@interface RCT_EXTERN_MODULE(LiveActivityCountdownReg, NSObject)
26-
//
27-
//@property (nonatomic, strong) LiveActivityCountdown *liveActivityCountdown;
28-
//
29-
////-(id)init;
30-
//-(id)init {
31-
// self = [super init];
32-
// if (self) {
33-
// self.liveActivityCountdown = [[LiveActivityCountdown alloc] init];
34-
// if (self.liveActivityCountdown) {
35-
// [self.liveActivityCountdown registerBackgroundTasks];
36-
// }
37-
// }
38-
// return self;
39-
//}
40-
//
41-
//
42-
//
43-
//RCT_EXTERN_METHOD(createLiveActivity:(NSDictionary *)config
44-
// withResolver:(RCTPromiseResolveBlock)resolve
45-
// withRejecter:(RCTPromiseRejectBlock)reject)
46-
//
47-
//RCT_EXTERN_METHOD(endLiveActivity:(NSString)activityId
48-
// withResolver:(RCTPromiseResolveBlock)resolve
49-
// withRejecter:(RCTPromiseRejectBlock)reject)
50-
//
51-
//RCT_EXTERN_METHOD(getLiveActivities:(RCTPromiseResolveBlock)resolve
52-
// withRejecter:(RCTPromiseRejectBlock)reject)
53-
//
54-
//+(BOOL)requiresMainQueueSetup
55-
//{
56-
// return NO;
57-
//}
58-
//
59-
//@end
60-
//
61-
////@implementation LiveActivityCountdownReg
62-
////
63-
////-(id)init {
64-
//// self = [super init];
65-
//// if (self) {
66-
//// self.liveActivityCountdown = [[LiveActivityCountdown alloc] init];
67-
//// if (self.liveActivityCountdown) {
68-
//// [self.liveActivityCountdown registerBackgroundTasks];
69-
//// }
70-
//// }
71-
//// return self;
72-
////}
73-
////
74-
////@end

ios/LiveActivityCountdown.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class LiveActivityCountdown: NSObject {
1414
let liveActivityCountdownWidgetExtensionAttributes = LiveActivityCountdownWidgetExtensionAttributes(
1515
title: config["title"] as! String,
1616
timerTitle: config["timerTitle"] as! String,
17+
buttonTitle: config["buttonTitle"] as! String,
1718
secondsUntilEnd: config["secondsUntilEnd"] as! Double,
1819
timerColor: config["timerColor"] as? String,
1920
imageName: config["imageName"] as? String

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"node": ">=18.0.0"
4747
},
4848
"dependencies": {
49-
"@txo/live-activity-countdown-view-react-native": "^1.0.2"
49+
"@txo/live-activity-countdown-view-react-native": "^1.0.3"
5050
},
5151
"devDependencies": {
5252
"@commitlint/cli": "^17.6.3",

0 commit comments

Comments
 (0)