react-native-insider 6.8.4-nh → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,36 @@
1
+ # Git Hooks
2
+
3
+ ## 📌 Purpose
4
+ This directory uses Git hooks to enforce standards and automate tasks during the development workflow.
5
+ The main example included is a **`commit-msg`** hook that enforces [Conventional Commits v1.0.0](https://www.conventionalcommits.org/en/v1.0.0/) rules with additional project-specific logic.
6
+
7
+ ---
8
+
9
+ ## 📂 Hooks Included
10
+
11
+ ### 1. `commit-msg`
12
+ Ensures commit messages follow the Conventional Commits specification, with custom rules:
13
+
14
+ - **Bypasses**:
15
+ - `Merge branch ...` commits (merge commits)
16
+ - `pick ...`, `reword ...`, `edit ...`, `squash ...`, `fixup ...`, `exec ...` messages (interactive rebase auto-generated commits)
17
+ - **JIRA Reference**:
18
+ - If the branch name contains a JIRA ID in the form `MOB-1234`, it will automatically append
19
+ `#Ref: MOB-1234` to the end of the commit message (if not already present).
20
+ - **Optional Description**:
21
+ - `<type>[<scope>][!]: <description>` — the description can be empty.
22
+ - **Header length**:
23
+ - Max 120 characters (hard limit)
24
+ - Warning if over 50 or 72 characters.
25
+
26
+ ---
27
+
28
+ ## 🔧 Installation
29
+
30
+ ### 1. Copy Hooks to `.git/hooks/`
31
+
32
+ Run the following commands under project's directory:
33
+ ```bash
34
+ cp .git-hooks/commit-msg .git/hooks/commit-msg
35
+ chmod +x .git/hooks/commit-msg
36
+ ```
@@ -0,0 +1,83 @@
1
+ #!/bin/sh
2
+
3
+ COMMIT_MSG_FILE="$1"
4
+ COMMIT_MSG_FIRST_LINE=$(head -n1 "$COMMIT_MSG_FILE")
5
+
6
+ # 1. Skip "Merge branch ..." commits
7
+ if echo "$COMMIT_MSG_FIRST_LINE" | grep -qE "^Merge branch "; then
8
+ exit 0
9
+ fi
10
+
11
+ # 2. Skip interactive rebase auto-commits
12
+ if echo "$COMMIT_MSG_FIRST_LINE" | grep -qE "^(pick|reword|edit|squash|fixup|exec) "; then
13
+ exit 0
14
+ fi
15
+
16
+ # Allowed Conventional Commit types (v1.0.0 + release)
17
+ ALLOWED_TYPES="feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert|release"
18
+
19
+ # Regex – type(scope)!?: description (description required)
20
+ FIRST_LINE_REGEX="^(${ALLOWED_TYPES})(\([^\)]+\))?(!)?: [^ ].+$"
21
+
22
+ error() {
23
+ echo "⛔ Error: $1"
24
+ }
25
+
26
+ warn() {
27
+ echo "⚠️ Warning: $1"
28
+ }
29
+
30
+ # 3. Validate header format
31
+ if ! echo "$COMMIT_MSG_FIRST_LINE" | grep -qE "${FIRST_LINE_REGEX}"; then
32
+ error "Commit mesajı başlığı Conventional Commits v1.0.0 formatına uymuyor."
33
+ echo "Mevcut mesaj: \"$COMMIT_MSG_FIRST_LINE\""
34
+ echo ""
35
+ echo "Beklenen format: <tip>[<scope>][!]: <açıklama>"
36
+ echo "Geçerli tipler: ${ALLOWED_TYPES}"
37
+ exit 1
38
+ fi
39
+
40
+ # 4. Header length check (max 120 chars)
41
+ HEADER_LENGTH=${#COMMIT_MSG_FIRST_LINE}
42
+ if [ "$HEADER_LENGTH" -gt 120 ]; then
43
+ error "İlk satır 120 karakteri aşıyor. (Mevcut uzunluk: $HEADER_LENGTH)"
44
+ exit 1
45
+ elif [ "$HEADER_LENGTH" -gt 72 ]; then
46
+ warn "İlk satır 72 karakterden uzun. (Mevcut uzunluk: $HEADER_LENGTH)"
47
+ fi
48
+
49
+ # 5. Body check (optional)
50
+ LINE_NO=0
51
+ while IFS= read -r line; do
52
+ LINE_NO=$((LINE_NO + 1))
53
+ # Second line should be empty if body exists
54
+ if [ "$LINE_NO" -eq 2 ] && [ -n "$line" ]; then
55
+ warn "İkinci satır boş olmalı (body varsa)."
56
+ fi
57
+ done < "$COMMIT_MSG_FILE"
58
+
59
+ # 6. BREAKING CHANGE footer check
60
+ if grep -qE '^BREAKING CHANGE: ' "$COMMIT_MSG_FILE"; then
61
+ if ! grep -qE '^BREAKING CHANGE: .{1,}' "$COMMIT_MSG_FILE"; then
62
+ error "BREAKING CHANGE açıklaması boş olamaz."
63
+ exit 1
64
+ fi
65
+ fi
66
+
67
+ # 7. Append JIRA ID from branch name
68
+ BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
69
+ JIRA_ID=$(echo "$BRANCH_NAME" | grep -oE 'MOB-[0-9]+')
70
+
71
+ if [ -n "$JIRA_ID" ]; then
72
+ if ! grep -q "$JIRA_ID" "$COMMIT_MSG_FILE"; then
73
+ {
74
+ echo ""
75
+ echo "#Ref: $JIRA_ID"
76
+ } >> "$COMMIT_MSG_FILE"
77
+ echo "ℹ️ Task ID referans olarak eklendi: $JIRA_ID"
78
+ fi
79
+ fi
80
+
81
+ echo "✅ Commit mesajı Conventional Commits v1.0.0 kurallarına uygun."
82
+ exit 0
83
+
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2016 Insider
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/RNInsider.podspec CHANGED
@@ -9,12 +9,12 @@ Pod::Spec.new do |s|
9
9
  s.authors = package_json['author']
10
10
  s.license = 'MIT'
11
11
  s.platform = :ios, '12.0'
12
- s.source = {:http => 'https://mobilesdk.useinsider.com/iOS/13.12.2/InsiderMobileIOSFramework.zip'}
12
+ s.source = {:http => 'https://mobilesdk.useinsider.com/iOS/14.0.0/InsiderMobileIOSFramework.zip'}
13
13
  s.source_files = 'ios/RNInsider/*.{h,m}'
14
14
  s.requires_arc = true
15
15
  s.static_framework = true
16
16
  s.dependency 'React'
17
- s.dependency 'InsiderMobile', '13.12.2'
18
- s.dependency 'InsiderGeofence', '1.2.2'
19
- s.dependency 'InsiderHybrid', '1.7.3'
17
+ s.dependency 'InsiderMobile', '14.0.0'
18
+ s.dependency 'InsiderGeofence', '1.2.3'
19
+ s.dependency 'InsiderHybrid', '1.7.4'
20
20
  end
@@ -35,7 +35,7 @@ repositories {
35
35
 
36
36
  dependencies {
37
37
  implementation "com.facebook.react:react-native:${getVersionFromPartner('reactNativeVersion', '+')}"
38
- implementation ('com.useinsider:insider:14.10.6-nh')
38
+ implementation ('com.useinsider:insider:15.0.1')
39
39
  implementation ('com.useinsider:insiderhybrid:1.3.2')
40
40
 
41
41
  implementation 'androidx.security:security-crypto:1.1.0-alpha06'
@@ -46,4 +46,8 @@ dependencies {
46
46
  implementation 'com.google.firebase:firebase-messaging:24.0.0'
47
47
  implementation 'com.google.android.gms:play-services-location:21.3.0'
48
48
  implementation 'com.google.android.play:review:2.0.1'
49
+
50
+ implementation 'com.huawei.hms:push:6.12.0.300'
51
+ implementation 'com.huawei.hms:ads-identifier:3.4.62.300'
52
+ implementation 'com.huawei.hms:location:6.11.0.301'
49
53
  }
@@ -726,6 +726,9 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
726
726
  });
727
727
  }
728
728
 
729
+ @ReactMethod
730
+ public void setAllowsBackgroundLocationUpdates(final boolean allowsBackgroundLocationUpdates) {}
731
+
729
732
  @ReactMethod
730
733
  public void removeInapp() {
731
734
  try {
@@ -746,6 +749,10 @@ public class RNInsiderModule extends ReactContextBaseJavaModule {
746
749
  }
747
750
  String provider = Insider.Instance.getCurrentProvider(reactContext);
748
751
  switch (provider) {
752
+ case "huawei":
753
+ com.huawei.hms.push.RemoteMessage hmsRemoteMessage = new com.huawei.hms.push.RemoteMessage.Builder("insider").setData(remoteMessageStringMap).build();
754
+ Insider.Instance.handleHMSNotification(reactContext, hmsRemoteMessage);
755
+ break;
749
756
  case "other":
750
757
  case "google":
751
758
  RemoteMessage fcmRemoteMessage = new RemoteMessage.Builder("insider").setData(remoteMessageStringMap).build();
@@ -0,0 +1,114 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Minimal GitHub Release Script
5
+ # Gereksinim: gh (GitHub CLI) -> gh auth login
6
+ # Bulunduğun branch'in HEAD'inden release oluşturur.
7
+ # Tag = --version (örn: 1.2.3)
8
+ # Notes = --generate-notes (varsayılan) | --notes-file | --no-notes
9
+
10
+ VERSION=""
11
+ ASSETS=()
12
+ DRY_RUN="false"
13
+ NOTES_FILE=""
14
+ NO_NOTES="false"
15
+ TITLE=""
16
+ flags=""
17
+
18
+ usage() {
19
+ cat <<EOF
20
+ Kullanım: $(basename "$0") -v <versiyon> [opsiyonlar]
21
+
22
+ Zorunlu:
23
+ -v, --version <semver> Örn: 1.2.3 (release tag adı)
24
+
25
+ Opsiyonel:
26
+ -a, --asset <path> Framework dosyası (tekrarlanabilir)
27
+ -t, --title <string> Release başlığı (yok ise version kullanılır)
28
+ --notes-file <path> Notları dosyadan al (--generate-notes devre dışı)
29
+ --no-notes Not ekleme veya oluşturma
30
+ --dry-run Komutları yazdır, çalıştırma
31
+
32
+ Örnekler:
33
+ $(basename "$0") -v 1.2.3
34
+ $(basename "$0") -v 1.2.3 --title Title --notes-file CHANGELOG.md
35
+ $(basename "$0") -v 1.2.3 --asset build/ios/InsiderMobile.xcframework.zip
36
+ EOF
37
+ }
38
+
39
+ # Check validity of arguments
40
+ while [[ $# -gt 0 ]]; do
41
+ case "$1" in
42
+ -v|--version) VERSION="$2"; shift 2;;
43
+ -a|--asset) ASSETS+=("$2"); shift 2;;
44
+ -t|--title) TITLE="$2"; shift 2;;
45
+ --notes-file) NOTES_FILE="$2"; shift 2;;
46
+ --no-notes) NO_NOTES="true"; shift;;
47
+ --dry-run) DRY_RUN="true"; shift;;
48
+ -h|--help) usage; exit 0;;
49
+ *) echo "⛔ Error: Bilinmeyen argüman: $1"; usage; exit 1;;
50
+ esac
51
+ done
52
+
53
+ if [[ -z "${VERSION}" ]]; then
54
+ echo "⛔ Error: --version parametresi zorunludur. Örn: -v 1.2.3"
55
+ usage
56
+ exit 1
57
+ fi
58
+
59
+ if ! command -v gh >/dev/null 2>&1; then
60
+ echo "⛔ Error: GitHub CLI (gh) bulunamadı."
61
+ echo "ℹ️ Kurulum: https://cli.github.com ve 'gh auth login' komutunu çalıştırın."
62
+ exit 1
63
+ fi
64
+
65
+ # Dry run method
66
+ run() {
67
+ echo "+ $*"
68
+ if [[ "${DRY_RUN}" == "false" ]]; then
69
+ eval "$@"
70
+ fi
71
+ }
72
+
73
+ # Check if there exists a release with same version
74
+ if gh release view "${VERSION}" >/dev/null 2>&1; then
75
+ echo "⛔ Error: Bu tag için zaten bir release mevcut: ${VERSION}"
76
+ exit 1
77
+ fi
78
+
79
+ # Assign title
80
+ if [[ -z "${TITLE}" ]]; then
81
+ flags+="--title \"${VERSION}\""
82
+ else
83
+ flags+="--title \"${TITLE}\""
84
+ fi
85
+
86
+ # Construct release flags
87
+ if [[ "${NO_NOTES}" == "true" ]]; then
88
+ flags+=" --notes \"\""
89
+ elif [[ -n "${NOTES_FILE}" ]]; then
90
+ if [[ ! -f "${NOTES_FILE}" ]]; then
91
+ echo "⛔ Error: Not dosyası bulunamadı: ${NOTES_FILE}"
92
+ exit 1
93
+ fi
94
+ flags+=" --notes-file \"${NOTES_FILE}\""
95
+ else
96
+ flags+=" --generate-notes"
97
+ fi
98
+
99
+ # Create the release on Github
100
+ run "gh release create \"${VERSION}\" ${flags}"
101
+
102
+ # Upload Framework file
103
+ if [[ ${#ASSETS[@]} -gt 0 ]]; then
104
+ echo "📦 Framework dosyası yükleniyor..."
105
+ for a in "${ASSETS[@]}"; do
106
+ if [[ -f "${a}" ]]; then
107
+ run "gh release upload \"${VERSION}\" \"${a}\" --clobber"
108
+ else
109
+ echo "⚠️ Warning: Asset bulunamadı, atlanıyor: ${a}"
110
+ fi
111
+ done
112
+ fi
113
+
114
+ echo "✅ Sürüm oluşturuldu: ${VERSION}"
package/index.d.ts CHANGED
@@ -95,6 +95,7 @@ declare module 'react-native-insider' {
95
95
  static visitCartPage(products: Array<RNInsiderProduct>): void;
96
96
  static visitWishlistPage(products: Array<RNInsiderProduct>): void;
97
97
  static startTrackingGeofence(): void;
98
+ static setAllowsBackgroundLocationUpdates(allowsBackgroundLocationUpdates: boolean): void;
98
99
  static handleNotification(notification: any): void;
99
100
  static enableIDFACollection(enableIDFACollection: boolean): void;
100
101
  static removeInapp(): void;
package/index.js CHANGED
@@ -606,6 +606,19 @@ export default class RNInsider {
606
606
  }
607
607
  }
608
608
 
609
+ static setAllowsBackgroundLocationUpdates(allowsBackgroundLocationUpdates) {
610
+ if (shouldNotProceed()) return;
611
+ if (checkParameters([{ type: 'boolean', value: allowsBackgroundLocationUpdates }])) {
612
+ showParameterWarningLog("allowsBackgroundLocationUpdates", [{ type: 'boolean', value: allowsBackgroundLocationUpdates }]);
613
+ return;
614
+ }
615
+ try {
616
+ Insider.setAllowsBackgroundLocationUpdates(allowsBackgroundLocationUpdates);
617
+ } catch (error) {
618
+ Insider.putErrorLog(generateJSONErrorString(error));
619
+ }
620
+ }
621
+
609
622
  static handleNotification(notification) {
610
623
  if (shouldNotProceed()) return;
611
624
  if (checkParameters([{ type: 'object', value: notification }])) {
@@ -531,6 +531,14 @@ RCT_EXPORT_METHOD(startTrackingGeofence) {
531
531
  }
532
532
  }
533
533
 
534
+ RCT_EXPORT_METHOD(setAllowsBackgroundLocationUpdates:(BOOL)allowsBackgroundLocationUpdates) {
535
+ @try {
536
+ [InsiderGeofence setAllowsBackgroundLocationUpdates:allowsBackgroundLocationUpdates];
537
+ } @catch (NSException *e) {
538
+ [Insider sendError:e desc:[NSString stringWithFormat:@"%s:%d", __func__, __LINE__]];
539
+ }
540
+ }
541
+
534
542
  RCT_EXPORT_METHOD(handleNotification:(NSDictionary *)notification) {
535
543
  @try {
536
544
  NSMutableDictionary *mutableNotification = [notification mutableCopy];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-insider",
3
- "version": "6.8.4-nh",
3
+ "version": "7.0.0",
4
4
  "description": "React Native Insider SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",