mmine 0.13.2 → 2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4ae59331db804b60ba314df98c85f4d2dc61231a28882976def64f7451bcc77
4
- data.tar.gz: f3745fc36a6e3e34c463982a600a9816e316d97e664dddba7985de7b53faa650
3
+ metadata.gz: ad8f25390166cad5b75342b7d040e6294d2d0b55f82e0e7f11853246de8b988b
4
+ data.tar.gz: 621d61b79f53dbeba9e550be7182f80e4927e4a093c703e99636fc8215eb304a
5
5
  SHA512:
6
- metadata.gz: b7d369b4960e4d877d692e5871803fafd38b56d13508838abc6e4392d0762ee31bf6e57c2a03650f2e8ac200252dc657be52447eea6d9315b6e9ac1bad34a0c2
7
- data.tar.gz: d7fb0d94e6bf88de3f6e4f7dc7929075756a0322420030968498e36709bde9c1ef9f29782ebbb71bb32d94ae4f08f1342b8db02f11a36f7708d4564c642def18
6
+ metadata.gz: 006d0d996da454e4363377c7762095cda71678b7e130f7023739ea48777dc19abc722e6e37a39ff0a8136c01cf43a936df68dc968f1dd90f8c5564aa00c55ca7
7
+ data.tar.gz: 85b4a3cb619becdcfa244c59b5f4a481d9bef2632cf5721aaba0280e6f2a7d9ad35d81ac0c403a35a5dd00f68f3a2468aca698bb1bc3ece2ec1660833d782215
data/bin/mmine CHANGED
@@ -8,9 +8,6 @@ first_arg, *the_rest = ARGV
8
8
  options = {}
9
9
  integrate_parse = OptionParser.new do |opts|
10
10
  opts.banner = "Usage: mmine [command] [parameters]"
11
- opts.on("-a", "--application-code APP_CODE", "Your Push Application Code from Infobip Portal") do |app_code|
12
- options[:"application-code"] = app_code
13
- end
14
11
  opts.on("-p", "--project XCODE_PROJECT", "Path for your Xcode project file (.xcodeproj)") do |project|
15
12
  options[:project] = project
16
13
  end
@@ -26,21 +23,12 @@ integrate_parse = OptionParser.new do |opts|
26
23
  opts.on("-c", "--cordova", "Provide Cordova project specific settings.") do |cordova|
27
24
  options[:cordova] = cordova
28
25
  end
29
- opts.on("-x", "--xcframework", "Should Cordova project use xcframework or framework.") do |xcframework|
30
- options[:xcframework] = xcframework
31
- end
32
26
  opts.on("--swift-version", "--swift-version SWIFT_VER", "Provide Swift Language version for notification extension (by default 5)") do |ver|
33
27
  options[:"swift-version"] = ver
34
28
  end
35
- opts.on("-s", "--override-signing", "Override parameters for MobileMessagingNotificationExtension signing using build flags") do |override|
29
+ opts.on("-s", "--override-signing", "Override parameters for MobileMessagingNotificationServiceExtension signing using build flags") do |override|
36
30
  options[:"override-signing"] = override
37
31
  end
38
- opts.on("-l", "--static-linkage", "If cocoapods static linkage used for MobileMessaging pods") do |static_linkage|
39
- options[:"static-linkage"] = static_linkage
40
- end
41
- opts.on("-r", "--react-native", "Provide React-Native specific settings") do |react_native|
42
- options[:"react-native"] = react_native
43
- end
44
32
  opts.on("--spm", "--spm", "If MobileMessaging is integrated using Swift Package Manager") do |spm|
45
33
  options[:"spm"] = spm
46
34
  end
@@ -54,12 +42,12 @@ case first_arg
54
42
  when "integrate"
55
43
  begin
56
44
  integrate_parse.parse!
57
- mandatory = [:"application-code",:"project", :"app-group", :"target"]
45
+ mandatory = [:"project", :"app-group", :"target"]
58
46
  missing = mandatory.select{ |param| options[param].nil? }
59
47
  unless missing.empty?
60
48
  raise OptionParser::MissingArgument.new(missing.join(', '))
61
49
  end
62
- integrator = NotificationExtensionIntegrator.new(options[:"application-code"], options[:project], options[:"app-group"], options[:target], options[:cordova] || false, options[:xcframework] || false, options[:"swift-version"] || "5", options[:"override-signing"] || false, options[:"static-linkage"] || false, options[:"react-native"] || false, options[:"spm"] || false)
50
+ integrator = NotificationExtensionIntegrator.new(options[:project], options[:"app-group"], options[:target], options[:cordova] || false, options[:"swift-version"] || "5", options[:"override-signing"] || false, options[:"spm"] || false)
63
51
  integrator.logger = Logger.new(STDOUT)
64
52
  integrator.logger.formatter = proc do |severity, datetime, progname, msg|
65
53
  "#{severity}: #{msg}\n"
@@ -1,3 +1,11 @@
1
+ #
2
+ # notification_extension_integrator.rb
3
+ # mobile-messaging-mmine
4
+ #
5
+ # Copyright (c) 2016-2025 Infobip Limited
6
+ # Licensed under the Apache License, Version 2.0
7
+ #
8
+
1
9
  require 'xcodeproj'
2
10
  require 'fileutils'
3
11
  require 'pathname'
@@ -14,25 +22,19 @@ module Mmine
14
22
  end
15
23
 
16
24
  class NotificationExtensionIntegrator
17
- def initialize(application_code, project_file_path, app_group, main_target_name, cordova = false, xcframework = false, swift_ver, override_signing, static_linkage, react_native, spm)
25
+ def initialize(project_file_path, app_group, main_target_name, cordova = false, swift_ver, override_signing, spm)
18
26
  @project_file_path = project_file_path
19
27
  @app_group = app_group
20
28
  @main_target_name = main_target_name
21
29
  @logger = nil
22
30
  @cordova = cordova
23
- @xcframework = xcframework
24
31
  @swift_version = swift_ver
25
- @application_code = application_code
26
32
  @override_signing = override_signing
27
- @static_linkage = static_linkage
28
- @react_native = react_native
29
33
  @spm = spm
30
34
 
31
35
  @project_dir = Pathname.new(@project_file_path).parent.to_s
32
36
  @project = Xcodeproj::Project.open(@project_file_path)
33
37
  @project_name = @project.root_object.name
34
- @framework_file_name = "MobileMessaging.framework"
35
-
36
38
  @main_target = @project.native_targets.select { |target| target.name == @main_target_name }.first
37
39
  @main_build_configurations_debug = @main_target.build_configurations.select { |config| config.type == :debug }
38
40
  @main_build_configurations_release = @main_target.build_configurations.select { |config| config.type == :release }
@@ -51,7 +53,7 @@ class NotificationExtensionIntegrator
51
53
 
52
54
  def setup_notification_extension
53
55
  puts "🏎 Integration starting... ver. #{Mmine::VERSION}"
54
- @logger.debug("Integration with parameters: \n application_code: #{@application_code} \n project_file_path: #{@project_file_path} \n app_group: #{@app_group} \n main_target_name: #{@main_target_name} \n cordova: #{@cordova} \n xcframework: #{@xcframework} \n swift_ver: #{@swift_ver} \n override_signing: #{@override_signing} \n static_linkage: #{@static_linkage} \n react_native: #{@react_native} \n spm: #{@spm}")
56
+ @logger.debug("Integration with parameters: \n project_file_path: #{@project_file_path} \n app_group: #{@app_group} \n main_target_name: #{@main_target_name} \n cordova: #{@cordova} \n swift_ver: #{@swift_ver} \n override_signing: #{@override_signing} \n spm: #{@spm}")
55
57
  @logger.debug("\n@main_target_build_configurations_debug #{@main_build_configurations_debug}\n@main_target_build_configurations_release #{@main_build_configurations_release}")
56
58
  @logger.debug("\n@main_target_build_configurations_debug #{JSON.pretty_generate(@main_build_settings_debug)}\n@main_target_build_configurations_release #{JSON.pretty_generate(@main_build_settings_release)}")
57
59
  create_notification_extension_target
@@ -76,7 +78,6 @@ class NotificationExtensionIntegrator
76
78
  setup_swift_version
77
79
  setup_product_name
78
80
  setup_extension_build_number
79
- setup_run_path_search_paths
80
81
  erease_bridging_header
81
82
 
82
83
  if @cordova
@@ -85,10 +86,6 @@ class NotificationExtensionIntegrator
85
86
  @extension_target_name,
86
87
  @extension_build_settings_debug,
87
88
  @extension_build_settings_release)
88
- #setup_extension_lib_cordova_link
89
- if @xcframework
90
- setup_framework_search_paths
91
- end
92
89
  else
93
90
  setup_entitlements(@main_build_configurations_debug.map { |config| config.build_settings['CODE_SIGN_ENTITLEMENTS'] },
94
91
  @main_build_configurations_release.map { |config| config.build_settings['CODE_SIGN_ENTITLEMENTS'] },
@@ -103,46 +100,89 @@ class NotificationExtensionIntegrator
103
100
  @extension_build_settings_release)
104
101
  end
105
102
 
106
- if @static_linkage
107
- setup_extension_lib_link('libMobileMessaging.a')
108
- unless @react_native
109
- setup_extension_lib_link('libCocoaLumberjack.a')
110
- end
111
- setup_library_search_paths
112
- end
113
-
114
103
  if @spm
115
- setup_extension_spm_dependency('MobileMessaging')
104
+ setup_extension_spm_dependency('MobileMessagingNotificationExtension')
105
+ elsif !@cordova
106
+ setup_podfile_extension_target
116
107
  end
117
108
 
118
109
  @project.save
119
110
  puts "🏁 Integration has been finished successfully!"
120
111
  end
121
112
 
122
- def setup_library_search_paths
123
- @logger.debug("Setup library search path")
124
- set_notification_extension_build_settings('LIBRARY_SEARCH_PATHS', '"${BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/CocoaLumberjack" "${BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/MobileMessaging"')
125
- end
126
-
127
113
  def setup_extension_spm_dependency(name)
128
- product_dependency = @main_target.package_product_dependencies.find { |ref| ref.product_name == name }
129
- unless product_dependency.nil? || @extension_target.package_product_dependencies.any? {|ref| ref.product_name == name}
130
- @extension_target.package_product_dependencies.append(product_dependency)
131
- end
114
+ @logger.info("Setting up SPM dependency '#{name}' for extension target")
115
+
116
+ # Check if extension already has the dependency (in packageProductDependencies or frameworks build phase)
117
+ if @extension_target.package_product_dependencies.any? { |ref| ref.product_name == name }
118
+ @logger.info("Extension target already has SPM dependency '#{name}' in packageProductDependencies, skipping")
119
+ return
120
+ end
121
+ if @extension_target.frameworks_build_phase.files.any? { |f| f.product_ref && f.product_ref.product_name == name }
122
+ @logger.info("Extension target already has SPM dependency '#{name}' in frameworks build phase, skipping")
123
+ return
124
+ end
125
+
126
+ # Find MobileMessaging dependency to get the package reference.
127
+ # Strategy 1: check packageProductDependencies on main target (older Xcode format)
128
+ mm_dep = @main_target.package_product_dependencies.find { |ref| ref.product_name == 'MobileMessaging' }
129
+ if mm_dep
130
+ @logger.info("Found MobileMessaging in main target packageProductDependencies")
131
+ else
132
+ # Strategy 2: scan frameworks build phase for PBXBuildFile with productRef (newer Xcode format)
133
+ @logger.info("MobileMessaging not found in packageProductDependencies, scanning frameworks build phase")
134
+ mm_build_file = @main_target.frameworks_build_phase.files.find { |f| f.product_ref && f.product_ref.product_name == 'MobileMessaging' }
135
+ mm_dep = mm_build_file.product_ref if mm_build_file
136
+ if mm_dep
137
+ @logger.info("Found MobileMessaging in main target frameworks build phase")
138
+ end
139
+ end
140
+
141
+ unless mm_dep
142
+ raise "Could not find MobileMessaging SPM product dependency on main target. Make sure the SDK is added as an SPM dependency."
143
+ end
144
+
145
+ package_ref = mm_dep.package
146
+ unless package_ref
147
+ raise "MobileMessaging dependency has no package reference. Cannot add extension dependency."
148
+ end
149
+
150
+ # Create the new XCSwiftPackageProductDependency
151
+ new_dep = @project.new(Xcodeproj::Project::Object::XCSwiftPackageProductDependency)
152
+ new_dep.product_name = name
153
+ new_dep.package = package_ref
154
+
155
+ # Add to packageProductDependencies on the extension target
156
+ @extension_target.package_product_dependencies << new_dep
157
+ @logger.info("Added SPM dependency '#{name}' to extension target packageProductDependencies")
158
+
159
+ # Also add a PBXBuildFile with productRef to the extension's frameworks build phase
160
+ build_file = @project.new(Xcodeproj::Project::Object::PBXBuildFile)
161
+ build_file.product_ref = new_dep
162
+ @extension_target.frameworks_build_phase.files << build_file
163
+ @logger.info("Added SPM dependency '#{name}' to extension target frameworks build phase")
132
164
  end
133
165
 
134
- def setup_extension_lib_link(lib_name)
135
- if @extension_target.frameworks_build_phase.files_references.select { |ref| ref.path == lib_name }.first
136
- @logger.info("Notification Extension target already has "+ lib_name + " linked.")
137
- else
138
- @logger.info("Adding "+ lib_name + " to Notification Extension target...")
139
- ref = @project['Frameworks'].new_file(lib_name);
140
- if ref
141
- @extension_target.frameworks_build_phase.add_file_reference(ref)
142
- else
143
- @logger.error("Unable to add "+ lib_name + " to Notification Extension target!")
144
- end
145
- end
166
+ def setup_podfile_extension_target
167
+ podfile_path = File.join(@project_dir, 'Podfile')
168
+ unless File.exist?(podfile_path)
169
+ @logger.info("No Podfile found at #{podfile_path}, skipping Podfile modification")
170
+ return
171
+ end
172
+
173
+ podfile_content = File.read(podfile_path)
174
+ extension_pod_name = 'MobileMessagingNotificationExtension'
175
+
176
+ if podfile_content.include?("target '#{@extension_target_name}'")
177
+ @logger.info("Podfile already contains target '#{@extension_target_name}', skipping")
178
+ return
179
+ end
180
+
181
+ @logger.info("Adding extension target '#{@extension_target_name}' with pod '#{extension_pod_name}' to Podfile")
182
+ podfile_entry = "\ntarget '#{@extension_target_name}' do\n pod '#{extension_pod_name}'\nend\n"
183
+ File.open(podfile_path, 'a') do |file|
184
+ file.write(podfile_entry)
185
+ end
146
186
  end
147
187
 
148
188
  def setup_extension_target_signing(override_signing)
@@ -171,12 +211,12 @@ class NotificationExtensionIntegrator
171
211
  end
172
212
 
173
213
  def create_notification_extension_target
174
- @extension_target_name = 'MobileMessagingNotificationExtension'
214
+ @extension_target_name = 'MobileMessagingNotificationServiceExtension'
175
215
  @extension_source_name_filepath = File.join(Mmine.root, 'resources', 'NotificationService.swift')
176
- @extension_dir_name = 'NotificationExtension'
216
+ @extension_dir_name = 'NotificationServiceExtension'
177
217
  @extension_destination_dir = File.join(@project_dir, @extension_dir_name)
178
218
  @extension_code_destination_filepath = File.join(@extension_destination_dir, 'NotificationService.swift')
179
- @extension_group_name = 'NotificationExtensionGroup'
219
+ @extension_group_name = 'NotificationServiceExtensionGroup'
180
220
  @extension_plist_name = 'MobileMessagingNotificationServiceExtension.plist'
181
221
  @extension_plist_source_filepath = File.join(Mmine.root, 'resources', @extension_plist_name)
182
222
  @extension_info_plist_path = File.join(@project_dir, @extension_dir_name, @extension_plist_name)
@@ -193,10 +233,6 @@ class NotificationExtensionIntegrator
193
233
  @extension_build_settings_debug = @extension_build_configurations_debug.map(&:build_settings)
194
234
  @extension_build_settings_release = @extension_build_configurations_release.map(&:build_settings)
195
235
 
196
- @extension_target.frameworks_build_phase.files_references.each { |ref|
197
- @extension_target.frameworks_build_phase.remove_file_reference(ref)
198
- }
199
-
200
236
  unless @main_target.build_configurations.any? { |config| config.name == "Release"}
201
237
  @extension_target.build_configuration_list.build_configurations.delete_if { |config| config.name == "Release"}
202
238
  end
@@ -226,27 +262,27 @@ class NotificationExtensionIntegrator
226
262
  filereference = get_notification_extension_group_reference.new_reference(@extension_code_destination_filepath)
227
263
  @extension_target.add_file_references([filereference])
228
264
  end
229
- put_application_code_in_source_code
230
- end
231
-
232
- def put_application_code_in_source_code
233
- source_code = File.read(@extension_code_destination_filepath)
234
- modified_source_code = source_code.gsub(/<# put your Application Code here #>/, "\"#{@application_code}\"")
235
- unless source_code == modified_source_code
236
- File.open(@extension_code_destination_filepath, "w") do |file|
237
- @logger.info("\tWriting application code to source code at #{@extension_code_destination_filepath}")
238
- file.puts modified_source_code
239
- end
240
- end
241
265
  end
242
266
 
243
267
  def setup_development_team
244
268
  align_notification_extension_build_settings('DEVELOPMENT_TEAM',
245
269
  @main_target.build_configurations)
270
+ align_notification_extension_build_settings('CODE_SIGN_STYLE',
271
+ @main_target.build_configurations)
272
+ align_notification_extension_build_settings('CODE_SIGN_IDENTITY',
273
+ @main_target.build_configurations)
246
274
  end
247
275
 
248
276
  def setup_deployment_target
249
- set_notification_extension_build_settings('IPHONEOS_DEPLOYMENT_TARGET', "13.0")
277
+ min_version = "15.0"
278
+ @main_target.build_configurations.each do |config|
279
+ main_target_version = config.resolve_build_setting('IPHONEOS_DEPLOYMENT_TARGET')
280
+ if main_target_version && Gem::Version.new(main_target_version) > Gem::Version.new(min_version)
281
+ min_version = main_target_version
282
+ end
283
+ end
284
+ @logger.info("Setting extension deployment target to #{min_version} (floor: 15.0, main target aligned)")
285
+ set_notification_extension_build_settings('IPHONEOS_DEPLOYMENT_TARGET', min_version)
250
286
  end
251
287
 
252
288
  def setup_notification_extension_info_plist
@@ -410,11 +446,18 @@ class NotificationExtensionIntegrator
410
446
 
411
447
  def setup_embed_extension_action
412
448
  phase_name = 'Embed App Extensions'
413
- unless @main_target.copy_files_build_phases.select { |phase| phase.name == phase_name }.first
414
- @logger.info("Adding copy files build phase: #{phase_name}")
415
- new_phase = @main_target.new_copy_files_build_phase(phase_name)
416
- new_phase.dst_subfolder_spec = '13'
417
- new_phase.add_file_reference(@extension_target.product_reference)
449
+ phase = @main_target.copy_files_build_phases.select { |p| p.name == phase_name }.first
450
+ if phase == nil
451
+ @logger.info("Creating copy files build phase: #{phase_name}")
452
+ phase = @main_target.new_copy_files_build_phase(phase_name)
453
+ phase.dst_subfolder_spec = '13'
454
+ end
455
+ already_embedded = phase.files.any? { |f| f.file_ref == @extension_target.product_reference }
456
+ if already_embedded
457
+ @logger.info("Extension product already embedded in '#{phase_name}', skipping")
458
+ else
459
+ @logger.info("Adding extension product to '#{phase_name}' phase")
460
+ phase.add_file_reference(@extension_target.product_reference)
418
461
  end
419
462
  end
420
463
 
@@ -429,14 +472,6 @@ class NotificationExtensionIntegrator
429
472
  set_notification_extension_build_settings('SWIFT_OBJC_BRIDGING_HEADER', '')
430
473
  end
431
474
 
432
- def setup_framework_search_paths
433
- set_notification_extension_build_settings('FRAMEWORK_SEARCH_PATHS', '$SRCROOT/$PROJECT/Plugins/com-infobip-plugins-mobilemessaging/**')
434
- end
435
-
436
- def setup_run_path_search_paths
437
- set_notification_extension_build_settings('LD_RUNPATH_SEARCH_PATHS', '@executable_path/../../Frameworks')
438
- end
439
-
440
475
  def setup_swift_version
441
476
  set_notification_extension_build_settings('SWIFT_VERSION', @swift_version)
442
477
  end
@@ -452,44 +487,6 @@ class NotificationExtensionIntegrator
452
487
  put_string_value_into_xml(build_key, '1', [@extension_info_plist_path])
453
488
  end
454
489
 
455
- def setup_extension_lib_cordova_link
456
- lib_cordova_name = 'libCordova.a'
457
- if @extension_target.frameworks_build_phase.files_references.select { |ref| ref.path == lib_cordova_name }.first
458
- @logger.info("Notification Extension target already has libCordova.a linked.")
459
- else
460
- @logger.info("Adding libCordova.a to Notification Extension target...")
461
- ref = @main_target.frameworks_build_phase.files_references.select { |ref| ref.path == lib_cordova_name }.first
462
- if ref
463
- @extension_target.frameworks_build_phase.add_file_reference(ref)
464
- else
465
- @logger.error("Main target has no libCordova.a as a linked library. Unable to add libCordova.a to Notification Extension target!")
466
- end
467
- end
468
- end
469
-
470
- def setup_copy_framework_script
471
- phase_name = "Copy Frameworks"
472
- shell_script = "/usr/local/bin/carthage copy-frameworks"
473
- input_path = "$SRCROOT/$PROJECT/Plugins/com-infobip-plugins-mobilemessaging/#{@framework_file_name}"
474
- output_path = "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/#{@framework_file_name}"
475
- existing_phase = @main_target.shell_script_build_phases.select { |phase| phase.shell_script.include? shell_script }.first
476
-
477
- if existing_phase
478
- existing_phase.input_paths |= [input_path]
479
- existing_phase.output_paths |= [output_path]
480
- @logger.info("Main target already has #{phase_name} shell script set up")
481
- else
482
- @logger.info("Setting up #{phase_name} shell script for main target")
483
- new_phase = @main_target.new_shell_script_build_phase(phase_name)
484
- new_phase.shell_path = "/bin/sh"
485
- new_phase.shell_script = shell_script
486
- new_phase.input_paths << input_path
487
- new_phase.output_paths << output_path
488
- end
489
-
490
- remove_embed_framework_phase
491
- end
492
-
493
490
  def setup_target_capabilities_for_extension_target
494
491
  mobile_messaging_capabilities = {"SystemCapabilities" =>
495
492
  {
@@ -524,22 +521,6 @@ class NotificationExtensionIntegrator
524
521
  end
525
522
  end
526
523
 
527
- def remove_embed_framework_phase
528
- @logger.info("Setting up embed framework script")
529
- @main_target.copy_files_build_phases
530
- .select { |phase|
531
- phase.dst_subfolder_spec == '10'
532
- }
533
- .each { |phase|
534
- phase.files.select { |file|
535
- file.display_name == @framework_file_name
536
- }.each { |file|
537
- @logger.info("\tRemoving embeddin #{@framework_file_name} from phase #{phase.display_name}")
538
- phase.remove_build_file(file)
539
- }
540
- }
541
- end
542
-
543
524
  def resolve_xcode_path(path)
544
525
  return path.sub(@project_dir, '$(PROJECT_DIR)')
545
526
  end
@@ -552,8 +533,12 @@ class NotificationExtensionIntegrator
552
533
  def align_notification_extension_build_settings(key, main_configurations)
553
534
  main_configurations.each do |config|
554
535
  value = config.resolve_build_setting(key)
555
- @logger.info("\tSetting extension build settings:\n\t\t#{config.name}: \t#{key}\t#{value}")
556
- @extension_target.build_configuration_list[config.name].build_settings[key] = value
536
+ if value.nil? || value.empty?
537
+ @logger.info("\tSkipping extension build setting (not set on main target):\n\t\t#{config.name}: \t#{key}")
538
+ else
539
+ @logger.info("\tSetting extension build settings:\n\t\t#{config.name}: \t#{key}\t#{value}")
540
+ @extension_target.build_configuration_list[config.name].build_settings[key] = value
541
+ end
557
542
  end
558
543
  end
559
544
 
data/lib/mmine/version.rb CHANGED
@@ -1,3 +1,11 @@
1
+ #
2
+ # version.rb
3
+ # mobile-messaging-mmine
4
+ #
5
+ # Copyright (c) 2016-2025 Infobip Limited
6
+ # Licensed under the Apache License, Version 2.0
7
+ #
8
+
1
9
  module Mmine
2
- VERSION = "0.13.2"
10
+ VERSION = "2.0.0"
3
11
  end
data/lib/mmine.rb CHANGED
@@ -1 +1,9 @@
1
+ #
2
+ # mmine.rb
3
+ # mobile-messaging-mmine
4
+ #
5
+ # Copyright (c) 2016-2025 Infobip Limited
6
+ # Licensed under the Apache License, Version 2.0
7
+ #
8
+
1
9
  require 'mmine/notification_extension_integrator'
@@ -5,7 +5,7 @@
5
5
  <key>CFBundleDevelopmentRegion</key>
6
6
  <string>$(DEVELOPMENT_LANGUAGE)</string>
7
7
  <key>CFBundleDisplayName</key>
8
- <string>MobileMessagingNotificationExtension</string>
8
+ <string>MobileMessagingNotificationServiceExtension</string>
9
9
  <key>CFBundleExecutable</key>
10
10
  <string>$(EXECUTABLE_NAME)</string>
11
11
  <key>CFBundleIdentifier</key>
@@ -1,9 +1,14 @@
1
+ //
1
2
  // NotificationService.swift
3
+ // mobile-messaging-mmine
4
+ //
5
+ // Copyright (c) 2016-2026 Infobip Limited
6
+ // Licensed under the Apache License, Version 2.0
7
+ //
2
8
 
3
9
  import UserNotifications
4
- import MobileMessaging
10
+ import MobileMessagingNotificationExtension
5
11
 
6
- @available(iOS 10.0, *)
7
12
  class NotificationService: UNNotificationServiceExtension {
8
13
 
9
14
  var contentHandler: ((UNNotificationContent) -> Void)?
@@ -13,14 +18,12 @@ class NotificationService: UNNotificationServiceExtension {
13
18
  self.contentHandler = contentHandler
14
19
  self.originalContent = request.content
15
20
 
16
- // Check if notification is from Infobip
17
- if MM_MTMessage.isCorrectPayload(request.content.userInfo) {
18
- MobileMessagingNotificationServiceExtension.startWithApplicationCode(<# put your Application Code here #>)
19
- MobileMessagingNotificationServiceExtension.didReceive(request, withContentHandler: contentHandler)
20
- } else {
21
- // Pass through non-Infobip notifications
22
- contentHandler(request.content)
23
- }
21
+ if MobileMessagingNotificationServiceExtension.isCorrectPayload(request.content.userInfo as? [String: Any] ?? [:]) {
22
+ MobileMessagingNotificationServiceExtension.didReceive(request, withContentHandler: contentHandler)
23
+ } else {
24
+ // handling by another push provider different than Infobip's
25
+ contentHandler(request.content)
26
+ }
24
27
  }
25
28
 
26
29
  override func serviceExtensionTimeWillExpire() {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mmine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Kadochnikov