expo-facebook-analytics 1.0.0 → 1.0.2
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.
- package/README.md +2 -2
- package/package.json +5 -4
- package/react-native.config.js +8 -0
- package/nitrogen/generated/.gitattributes +0 -1
- package/nitrogen/generated/android/NitroFBAnalytics+autolinking.cmake +0 -81
- package/nitrogen/generated/android/NitroFBAnalytics+autolinking.gradle +0 -27
- package/nitrogen/generated/android/NitroFBAnalyticsOnLoad.cpp +0 -44
- package/nitrogen/generated/android/NitroFBAnalyticsOnLoad.hpp +0 -25
- package/nitrogen/generated/android/c++/JHybridFacebookAnalyticsSpec.cpp +0 -157
- package/nitrogen/generated/android/c++/JHybridFacebookAnalyticsSpec.hpp +0 -79
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/com/nitrofbanalytics/HybridFacebookAnalyticsSpec.kt +0 -110
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/com/nitrofbanalytics/NitroFBAnalyticsOnLoad.kt +0 -35
- package/nitrogen/generated/ios/NitroFBAnalytics+autolinking.rb +0 -60
- package/nitrogen/generated/ios/NitroFBAnalytics-Swift-Cxx-Bridge.cpp +0 -49
- package/nitrogen/generated/ios/NitroFBAnalytics-Swift-Cxx-Bridge.hpp +0 -171
- package/nitrogen/generated/ios/NitroFBAnalytics-Swift-Cxx-Umbrella.hpp +0 -47
- package/nitrogen/generated/ios/NitroFBAnalyticsAutolinking.mm +0 -33
- package/nitrogen/generated/ios/NitroFBAnalyticsAutolinking.swift +0 -26
- package/nitrogen/generated/ios/c++/HybridFacebookAnalyticsSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridFacebookAnalyticsSpecSwift.hpp +0 -167
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +0 -47
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +0 -54
- package/nitrogen/generated/ios/swift/HybridFacebookAnalyticsSpec.swift +0 -69
- package/nitrogen/generated/ios/swift/HybridFacebookAnalyticsSpec_cxx.swift +0 -410
- package/nitrogen/generated/shared/c++/HybridFacebookAnalyticsSpec.cpp +0 -34
- package/nitrogen/generated/shared/c++/HybridFacebookAnalyticsSpec.hpp +0 -78
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# NitroFBAnalytics+autolinking.rb
|
|
3
|
-
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
# https://github.com/mrousavy/nitro
|
|
5
|
-
# Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
# This is a Ruby script that adds all files generated by Nitrogen
|
|
9
|
-
# to the given podspec.
|
|
10
|
-
#
|
|
11
|
-
# To use it, add this to your .podspec:
|
|
12
|
-
# ```ruby
|
|
13
|
-
# Pod::Spec.new do |spec|
|
|
14
|
-
# # ...
|
|
15
|
-
#
|
|
16
|
-
# # Add all files generated by Nitrogen
|
|
17
|
-
# load 'nitrogen/generated/ios/NitroFBAnalytics+autolinking.rb'
|
|
18
|
-
# add_nitrogen_files(spec)
|
|
19
|
-
# end
|
|
20
|
-
# ```
|
|
21
|
-
|
|
22
|
-
def add_nitrogen_files(spec)
|
|
23
|
-
Pod::UI.puts "[NitroModules] 🔥 NitroFBAnalytics is boosted by nitro!"
|
|
24
|
-
|
|
25
|
-
spec.dependency "NitroModules"
|
|
26
|
-
|
|
27
|
-
current_source_files = Array(spec.attributes_hash['source_files'])
|
|
28
|
-
spec.source_files = current_source_files + [
|
|
29
|
-
# Generated cross-platform specs
|
|
30
|
-
"nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
|
|
31
|
-
# Generated bridges for the cross-platform specs
|
|
32
|
-
"nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
|
|
33
|
-
]
|
|
34
|
-
|
|
35
|
-
current_public_header_files = Array(spec.attributes_hash['public_header_files'])
|
|
36
|
-
spec.public_header_files = current_public_header_files + [
|
|
37
|
-
# Generated specs
|
|
38
|
-
"nitrogen/generated/shared/**/*.{h,hpp}",
|
|
39
|
-
# Swift to C++ bridging helpers
|
|
40
|
-
"nitrogen/generated/ios/NitroFBAnalytics-Swift-Cxx-Bridge.hpp"
|
|
41
|
-
]
|
|
42
|
-
|
|
43
|
-
current_private_header_files = Array(spec.attributes_hash['private_header_files'])
|
|
44
|
-
spec.private_header_files = current_private_header_files + [
|
|
45
|
-
# iOS specific specs
|
|
46
|
-
"nitrogen/generated/ios/c++/**/*.{h,hpp}",
|
|
47
|
-
# Views are framework-specific and should be private
|
|
48
|
-
"nitrogen/generated/shared/**/views/**/*"
|
|
49
|
-
]
|
|
50
|
-
|
|
51
|
-
current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
|
|
52
|
-
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
|
-
# Use C++ 20
|
|
54
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
-
# Enables C++ <-> Swift interop (by default it's only ObjC)
|
|
56
|
-
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
|
-
# Enables stricter modular headers
|
|
58
|
-
"DEFINES_MODULE" => "YES",
|
|
59
|
-
})
|
|
60
|
-
end
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// NitroFBAnalytics-Swift-Cxx-Bridge.cpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#include "NitroFBAnalytics-Swift-Cxx-Bridge.hpp"
|
|
9
|
-
|
|
10
|
-
// Include C++ implementation defined types
|
|
11
|
-
#include "HybridFacebookAnalyticsSpecSwift.hpp"
|
|
12
|
-
#include "NitroFBAnalytics-Swift-Cxx-Umbrella.hpp"
|
|
13
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
-
|
|
15
|
-
namespace margelo::nitro::fbanalytics::bridge::swift {
|
|
16
|
-
|
|
17
|
-
// pragma MARK: std::function<void(const std::optional<std::string>& /* result */)>
|
|
18
|
-
Func_void_std__optional_std__string_ create_Func_void_std__optional_std__string_(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
19
|
-
auto swiftClosure = NitroFBAnalytics::Func_void_std__optional_std__string_::fromUnsafe(swiftClosureWrapper);
|
|
20
|
-
return [swiftClosure = std::move(swiftClosure)](const std::optional<std::string>& result) mutable -> void {
|
|
21
|
-
swiftClosure.call(result);
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
26
|
-
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
27
|
-
auto swiftClosure = NitroFBAnalytics::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
|
|
28
|
-
return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
|
|
29
|
-
swiftClosure.call(error);
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// pragma MARK: std::shared_ptr<HybridFacebookAnalyticsSpec>
|
|
34
|
-
std::shared_ptr<HybridFacebookAnalyticsSpec> create_std__shared_ptr_HybridFacebookAnalyticsSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
35
|
-
NitroFBAnalytics::HybridFacebookAnalyticsSpec_cxx swiftPart = NitroFBAnalytics::HybridFacebookAnalyticsSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
36
|
-
return std::make_shared<margelo::nitro::fbanalytics::HybridFacebookAnalyticsSpecSwift>(swiftPart);
|
|
37
|
-
}
|
|
38
|
-
void* NON_NULL get_std__shared_ptr_HybridFacebookAnalyticsSpec_(std__shared_ptr_HybridFacebookAnalyticsSpec_ cppType) {
|
|
39
|
-
std::shared_ptr<margelo::nitro::fbanalytics::HybridFacebookAnalyticsSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::fbanalytics::HybridFacebookAnalyticsSpecSwift>(cppType);
|
|
40
|
-
#ifdef NITRO_DEBUG
|
|
41
|
-
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
42
|
-
throw std::runtime_error("Class \"HybridFacebookAnalyticsSpec\" is not implemented in Swift!");
|
|
43
|
-
}
|
|
44
|
-
#endif
|
|
45
|
-
NitroFBAnalytics::HybridFacebookAnalyticsSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
46
|
-
return swiftPart.toUnsafe();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
} // namespace margelo::nitro::fbanalytics::bridge::swift
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// NitroFBAnalytics-Swift-Cxx-Bridge.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
// Forward declarations of C++ defined types
|
|
11
|
-
// Forward declaration of `HybridFacebookAnalyticsSpec` to properly resolve imports.
|
|
12
|
-
namespace margelo::nitro::fbanalytics { class HybridFacebookAnalyticsSpec; }
|
|
13
|
-
|
|
14
|
-
// Forward declarations of Swift defined types
|
|
15
|
-
// Forward declaration of `HybridFacebookAnalyticsSpec_cxx` to properly resolve imports.
|
|
16
|
-
namespace NitroFBAnalytics { class HybridFacebookAnalyticsSpec_cxx; }
|
|
17
|
-
|
|
18
|
-
// Include C++ defined types
|
|
19
|
-
#include "HybridFacebookAnalyticsSpec.hpp"
|
|
20
|
-
#include <NitroModules/Promise.hpp>
|
|
21
|
-
#include <NitroModules/PromiseHolder.hpp>
|
|
22
|
-
#include <NitroModules/Result.hpp>
|
|
23
|
-
#include <exception>
|
|
24
|
-
#include <functional>
|
|
25
|
-
#include <memory>
|
|
26
|
-
#include <optional>
|
|
27
|
-
#include <string>
|
|
28
|
-
#include <unordered_map>
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
32
|
-
* as well as helper functions to interact with those C++ types from Swift.
|
|
33
|
-
*/
|
|
34
|
-
namespace margelo::nitro::fbanalytics::bridge::swift {
|
|
35
|
-
|
|
36
|
-
// pragma MARK: std::unordered_map<std::string, std::string>
|
|
37
|
-
/**
|
|
38
|
-
* Specialized version of `std::unordered_map<std::string, std::string>`.
|
|
39
|
-
*/
|
|
40
|
-
using std__unordered_map_std__string__std__string_ = std::unordered_map<std::string, std::string>;
|
|
41
|
-
inline std::unordered_map<std::string, std::string> create_std__unordered_map_std__string__std__string_(size_t size) noexcept {
|
|
42
|
-
std::unordered_map<std::string, std::string> map;
|
|
43
|
-
map.reserve(size);
|
|
44
|
-
return map;
|
|
45
|
-
}
|
|
46
|
-
inline std::vector<std::string> get_std__unordered_map_std__string__std__string__keys(const std__unordered_map_std__string__std__string_& map) noexcept {
|
|
47
|
-
std::vector<std::string> keys;
|
|
48
|
-
keys.reserve(map.size());
|
|
49
|
-
for (const auto& entry : map) {
|
|
50
|
-
keys.push_back(entry.first);
|
|
51
|
-
}
|
|
52
|
-
return keys;
|
|
53
|
-
}
|
|
54
|
-
inline std::string get_std__unordered_map_std__string__std__string__value(const std__unordered_map_std__string__std__string_& map, const std::string& key) noexcept {
|
|
55
|
-
return map.find(key)->second;
|
|
56
|
-
}
|
|
57
|
-
inline void emplace_std__unordered_map_std__string__std__string_(std__unordered_map_std__string__std__string_& map, const std::string& key, const std::string& value) noexcept {
|
|
58
|
-
map.emplace(key, value);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// pragma MARK: std::optional<std::string>
|
|
62
|
-
/**
|
|
63
|
-
* Specialized version of `std::optional<std::string>`.
|
|
64
|
-
*/
|
|
65
|
-
using std__optional_std__string_ = std::optional<std::string>;
|
|
66
|
-
inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
|
|
67
|
-
return std::optional<std::string>(value);
|
|
68
|
-
}
|
|
69
|
-
inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
70
|
-
return optional.has_value();
|
|
71
|
-
}
|
|
72
|
-
inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
73
|
-
return *optional;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// pragma MARK: std::shared_ptr<Promise<std::optional<std::string>>>
|
|
77
|
-
/**
|
|
78
|
-
* Specialized version of `std::shared_ptr<Promise<std::optional<std::string>>>`.
|
|
79
|
-
*/
|
|
80
|
-
using std__shared_ptr_Promise_std__optional_std__string___ = std::shared_ptr<Promise<std::optional<std::string>>>;
|
|
81
|
-
inline std::shared_ptr<Promise<std::optional<std::string>>> create_std__shared_ptr_Promise_std__optional_std__string___() noexcept {
|
|
82
|
-
return Promise<std::optional<std::string>>::create();
|
|
83
|
-
}
|
|
84
|
-
inline PromiseHolder<std::optional<std::string>> wrap_std__shared_ptr_Promise_std__optional_std__string___(std::shared_ptr<Promise<std::optional<std::string>>> promise) noexcept {
|
|
85
|
-
return PromiseHolder<std::optional<std::string>>(std::move(promise));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// pragma MARK: std::function<void(const std::optional<std::string>& /* result */)>
|
|
89
|
-
/**
|
|
90
|
-
* Specialized version of `std::function<void(const std::optional<std::string>&)>`.
|
|
91
|
-
*/
|
|
92
|
-
using Func_void_std__optional_std__string_ = std::function<void(const std::optional<std::string>& /* result */)>;
|
|
93
|
-
/**
|
|
94
|
-
* Wrapper class for a `std::function<void(const std::optional<std::string>& / * result * /)>`, this can be used from Swift.
|
|
95
|
-
*/
|
|
96
|
-
class Func_void_std__optional_std__string__Wrapper final {
|
|
97
|
-
public:
|
|
98
|
-
explicit Func_void_std__optional_std__string__Wrapper(std::function<void(const std::optional<std::string>& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::optional<std::string>& /* result */)>>(std::move(func))) {}
|
|
99
|
-
inline void call(std::optional<std::string> result) const noexcept {
|
|
100
|
-
_function->operator()(result);
|
|
101
|
-
}
|
|
102
|
-
private:
|
|
103
|
-
std::unique_ptr<std::function<void(const std::optional<std::string>& /* result */)>> _function;
|
|
104
|
-
} SWIFT_NONCOPYABLE;
|
|
105
|
-
Func_void_std__optional_std__string_ create_Func_void_std__optional_std__string_(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
106
|
-
inline Func_void_std__optional_std__string__Wrapper wrap_Func_void_std__optional_std__string_(Func_void_std__optional_std__string_ value) noexcept {
|
|
107
|
-
return Func_void_std__optional_std__string__Wrapper(std::move(value));
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
111
|
-
/**
|
|
112
|
-
* Specialized version of `std::function<void(const std::exception_ptr&)>`.
|
|
113
|
-
*/
|
|
114
|
-
using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
|
|
115
|
-
/**
|
|
116
|
-
* Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
|
|
117
|
-
*/
|
|
118
|
-
class Func_void_std__exception_ptr_Wrapper final {
|
|
119
|
-
public:
|
|
120
|
-
explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
|
|
121
|
-
inline void call(std::exception_ptr error) const noexcept {
|
|
122
|
-
_function->operator()(error);
|
|
123
|
-
}
|
|
124
|
-
private:
|
|
125
|
-
std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
|
|
126
|
-
} SWIFT_NONCOPYABLE;
|
|
127
|
-
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
128
|
-
inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
|
|
129
|
-
return Func_void_std__exception_ptr_Wrapper(std::move(value));
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// pragma MARK: std::shared_ptr<HybridFacebookAnalyticsSpec>
|
|
133
|
-
/**
|
|
134
|
-
* Specialized version of `std::shared_ptr<HybridFacebookAnalyticsSpec>`.
|
|
135
|
-
*/
|
|
136
|
-
using std__shared_ptr_HybridFacebookAnalyticsSpec_ = std::shared_ptr<HybridFacebookAnalyticsSpec>;
|
|
137
|
-
std::shared_ptr<HybridFacebookAnalyticsSpec> create_std__shared_ptr_HybridFacebookAnalyticsSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
138
|
-
void* NON_NULL get_std__shared_ptr_HybridFacebookAnalyticsSpec_(std__shared_ptr_HybridFacebookAnalyticsSpec_ cppType);
|
|
139
|
-
|
|
140
|
-
// pragma MARK: std::weak_ptr<HybridFacebookAnalyticsSpec>
|
|
141
|
-
using std__weak_ptr_HybridFacebookAnalyticsSpec_ = std::weak_ptr<HybridFacebookAnalyticsSpec>;
|
|
142
|
-
inline std__weak_ptr_HybridFacebookAnalyticsSpec_ weakify_std__shared_ptr_HybridFacebookAnalyticsSpec_(const std::shared_ptr<HybridFacebookAnalyticsSpec>& strong) noexcept { return strong; }
|
|
143
|
-
|
|
144
|
-
// pragma MARK: Result<void>
|
|
145
|
-
using Result_void_ = Result<void>;
|
|
146
|
-
inline Result_void_ create_Result_void_() noexcept {
|
|
147
|
-
return Result<void>::withValue();
|
|
148
|
-
}
|
|
149
|
-
inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
|
|
150
|
-
return Result<void>::withError(error);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// pragma MARK: Result<std::optional<std::string>>
|
|
154
|
-
using Result_std__optional_std__string__ = Result<std::optional<std::string>>;
|
|
155
|
-
inline Result_std__optional_std__string__ create_Result_std__optional_std__string__(const std::optional<std::string>& value) noexcept {
|
|
156
|
-
return Result<std::optional<std::string>>::withValue(value);
|
|
157
|
-
}
|
|
158
|
-
inline Result_std__optional_std__string__ create_Result_std__optional_std__string__(const std::exception_ptr& error) noexcept {
|
|
159
|
-
return Result<std::optional<std::string>>::withError(error);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// pragma MARK: Result<std::shared_ptr<Promise<std::optional<std::string>>>>
|
|
163
|
-
using Result_std__shared_ptr_Promise_std__optional_std__string____ = Result<std::shared_ptr<Promise<std::optional<std::string>>>>;
|
|
164
|
-
inline Result_std__shared_ptr_Promise_std__optional_std__string____ create_Result_std__shared_ptr_Promise_std__optional_std__string____(const std::shared_ptr<Promise<std::optional<std::string>>>& value) noexcept {
|
|
165
|
-
return Result<std::shared_ptr<Promise<std::optional<std::string>>>>::withValue(value);
|
|
166
|
-
}
|
|
167
|
-
inline Result_std__shared_ptr_Promise_std__optional_std__string____ create_Result_std__shared_ptr_Promise_std__optional_std__string____(const std::exception_ptr& error) noexcept {
|
|
168
|
-
return Result<std::shared_ptr<Promise<std::optional<std::string>>>>::withError(error);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
} // namespace margelo::nitro::fbanalytics::bridge::swift
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// NitroFBAnalytics-Swift-Cxx-Umbrella.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
// Forward declarations of C++ defined types
|
|
11
|
-
// Forward declaration of `HybridFacebookAnalyticsSpec` to properly resolve imports.
|
|
12
|
-
namespace margelo::nitro::fbanalytics { class HybridFacebookAnalyticsSpec; }
|
|
13
|
-
|
|
14
|
-
// Include C++ defined types
|
|
15
|
-
#include "HybridFacebookAnalyticsSpec.hpp"
|
|
16
|
-
#include <NitroModules/Promise.hpp>
|
|
17
|
-
#include <NitroModules/Result.hpp>
|
|
18
|
-
#include <exception>
|
|
19
|
-
#include <memory>
|
|
20
|
-
#include <optional>
|
|
21
|
-
#include <string>
|
|
22
|
-
#include <unordered_map>
|
|
23
|
-
|
|
24
|
-
// C++ helpers for Swift
|
|
25
|
-
#include "NitroFBAnalytics-Swift-Cxx-Bridge.hpp"
|
|
26
|
-
|
|
27
|
-
// Common C++ types used in Swift
|
|
28
|
-
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
29
|
-
#include <NitroModules/AnyMapUtils.hpp>
|
|
30
|
-
#include <NitroModules/RuntimeError.hpp>
|
|
31
|
-
#include <NitroModules/DateToChronoDate.hpp>
|
|
32
|
-
|
|
33
|
-
// Forward declarations of Swift defined types
|
|
34
|
-
// Forward declaration of `HybridFacebookAnalyticsSpec_cxx` to properly resolve imports.
|
|
35
|
-
namespace NitroFBAnalytics { class HybridFacebookAnalyticsSpec_cxx; }
|
|
36
|
-
|
|
37
|
-
// Include Swift defined types
|
|
38
|
-
#if __has_include("NitroFBAnalytics-Swift.h")
|
|
39
|
-
// This header is generated by Xcode/Swift on every app build.
|
|
40
|
-
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "NitroFBAnalytics".
|
|
41
|
-
#include "NitroFBAnalytics-Swift.h"
|
|
42
|
-
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
43
|
-
#elif __has_include(<NitroFBAnalytics/NitroFBAnalytics-Swift.h>)
|
|
44
|
-
#include <NitroFBAnalytics/NitroFBAnalytics-Swift.h>
|
|
45
|
-
#else
|
|
46
|
-
#error NitroFBAnalytics's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "NitroFBAnalytics", and try building the app first.
|
|
47
|
-
#endif
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// NitroFBAnalyticsAutolinking.mm
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
-
#import "NitroFBAnalytics-Swift-Cxx-Umbrella.hpp"
|
|
11
|
-
#import <type_traits>
|
|
12
|
-
|
|
13
|
-
#include "HybridFacebookAnalyticsSpecSwift.hpp"
|
|
14
|
-
|
|
15
|
-
@interface NitroFBAnalyticsAutolinking : NSObject
|
|
16
|
-
@end
|
|
17
|
-
|
|
18
|
-
@implementation NitroFBAnalyticsAutolinking
|
|
19
|
-
|
|
20
|
-
+ (void) load {
|
|
21
|
-
using namespace margelo::nitro;
|
|
22
|
-
using namespace margelo::nitro::fbanalytics;
|
|
23
|
-
|
|
24
|
-
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
25
|
-
"FacebookAnalytics",
|
|
26
|
-
[]() -> std::shared_ptr<HybridObject> {
|
|
27
|
-
std::shared_ptr<HybridFacebookAnalyticsSpec> hybridObject = NitroFBAnalytics::NitroFBAnalyticsAutolinking::createFacebookAnalytics();
|
|
28
|
-
return hybridObject;
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@end
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// NitroFBAnalyticsAutolinking.swift
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
import NitroModules
|
|
9
|
-
|
|
10
|
-
// TODO: Use empty enums once Swift supports exporting them as namespaces
|
|
11
|
-
// See: https://github.com/swiftlang/swift/pull/83616
|
|
12
|
-
public final class NitroFBAnalyticsAutolinking {
|
|
13
|
-
public typealias bridge = margelo.nitro.fbanalytics.bridge.swift
|
|
14
|
-
|
|
15
|
-
public static func createFacebookAnalytics() -> bridge.std__shared_ptr_HybridFacebookAnalyticsSpec_ {
|
|
16
|
-
let hybridObject = HybridFacebookAnalytics()
|
|
17
|
-
return { () -> bridge.std__shared_ptr_HybridFacebookAnalyticsSpec_ in
|
|
18
|
-
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
19
|
-
return __cxxWrapped.getCxxPart()
|
|
20
|
-
}()
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public static func isFacebookAnalyticsRecyclable() -> Bool {
|
|
24
|
-
return HybridFacebookAnalytics.self is any RecyclableView.Type
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridFacebookAnalyticsSpecSwift.cpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#include "HybridFacebookAnalyticsSpecSwift.hpp"
|
|
9
|
-
|
|
10
|
-
namespace margelo::nitro::fbanalytics {
|
|
11
|
-
} // namespace margelo::nitro::fbanalytics
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridFacebookAnalyticsSpecSwift.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#include "HybridFacebookAnalyticsSpec.hpp"
|
|
11
|
-
|
|
12
|
-
// Forward declaration of `HybridFacebookAnalyticsSpec_cxx` to properly resolve imports.
|
|
13
|
-
namespace NitroFBAnalytics { class HybridFacebookAnalyticsSpec_cxx; }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
#include <string>
|
|
18
|
-
#include <unordered_map>
|
|
19
|
-
#include <optional>
|
|
20
|
-
#include <NitroModules/Promise.hpp>
|
|
21
|
-
|
|
22
|
-
#include "NitroFBAnalytics-Swift-Cxx-Umbrella.hpp"
|
|
23
|
-
|
|
24
|
-
namespace margelo::nitro::fbanalytics {
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* The C++ part of HybridFacebookAnalyticsSpec_cxx.swift.
|
|
28
|
-
*
|
|
29
|
-
* HybridFacebookAnalyticsSpecSwift (C++) accesses HybridFacebookAnalyticsSpec_cxx (Swift), and might
|
|
30
|
-
* contain some additional bridging code for C++ <> Swift interop.
|
|
31
|
-
*
|
|
32
|
-
* Since this obviously introduces an overhead, I hope at some point in
|
|
33
|
-
* the future, HybridFacebookAnalyticsSpec_cxx can directly inherit from the C++ class HybridFacebookAnalyticsSpec
|
|
34
|
-
* to simplify the whole structure and memory management.
|
|
35
|
-
*/
|
|
36
|
-
class HybridFacebookAnalyticsSpecSwift: public virtual HybridFacebookAnalyticsSpec {
|
|
37
|
-
public:
|
|
38
|
-
// Constructor from a Swift instance
|
|
39
|
-
explicit HybridFacebookAnalyticsSpecSwift(const NitroFBAnalytics::HybridFacebookAnalyticsSpec_cxx& swiftPart):
|
|
40
|
-
HybridObject(HybridFacebookAnalyticsSpec::TAG),
|
|
41
|
-
_swiftPart(swiftPart) { }
|
|
42
|
-
|
|
43
|
-
public:
|
|
44
|
-
// Get the Swift part
|
|
45
|
-
inline NitroFBAnalytics::HybridFacebookAnalyticsSpec_cxx& getSwiftPart() noexcept {
|
|
46
|
-
return _swiftPart;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
public:
|
|
50
|
-
inline size_t getExternalMemorySize() noexcept override {
|
|
51
|
-
return _swiftPart.getMemorySize();
|
|
52
|
-
}
|
|
53
|
-
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
54
|
-
if (auto otherCast = std::dynamic_pointer_cast<HybridFacebookAnalyticsSpecSwift>(other)) {
|
|
55
|
-
return _swiftPart.equals(otherCast->_swiftPart);
|
|
56
|
-
}
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
void dispose() noexcept override {
|
|
60
|
-
_swiftPart.dispose();
|
|
61
|
-
}
|
|
62
|
-
std::string toString() override {
|
|
63
|
-
return _swiftPart.toString();
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
public:
|
|
67
|
-
// Properties
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
public:
|
|
71
|
-
// Methods
|
|
72
|
-
inline void logEvent(const std::string& eventName, double valueToSum, const std::unordered_map<std::string, std::string>& params) override {
|
|
73
|
-
auto __result = _swiftPart.logEvent(eventName, std::forward<decltype(valueToSum)>(valueToSum), params);
|
|
74
|
-
if (__result.hasError()) [[unlikely]] {
|
|
75
|
-
std::rethrow_exception(__result.error());
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
inline void logEventWithoutParams(const std::string& eventName, double valueToSum) override {
|
|
79
|
-
auto __result = _swiftPart.logEventWithoutParams(eventName, std::forward<decltype(valueToSum)>(valueToSum));
|
|
80
|
-
if (__result.hasError()) [[unlikely]] {
|
|
81
|
-
std::rethrow_exception(__result.error());
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
inline void logPurchase(double amount, const std::string& currency, const std::unordered_map<std::string, std::string>& params) override {
|
|
85
|
-
auto __result = _swiftPart.logPurchase(std::forward<decltype(amount)>(amount), currency, params);
|
|
86
|
-
if (__result.hasError()) [[unlikely]] {
|
|
87
|
-
std::rethrow_exception(__result.error());
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
inline void logPushNotificationOpen(const std::unordered_map<std::string, std::string>& payload) override {
|
|
91
|
-
auto __result = _swiftPart.logPushNotificationOpen(payload);
|
|
92
|
-
if (__result.hasError()) [[unlikely]] {
|
|
93
|
-
std::rethrow_exception(__result.error());
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
inline void setUserID(const std::string& userID) override {
|
|
97
|
-
auto __result = _swiftPart.setUserID(userID);
|
|
98
|
-
if (__result.hasError()) [[unlikely]] {
|
|
99
|
-
std::rethrow_exception(__result.error());
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
inline void clearUserID() override {
|
|
103
|
-
auto __result = _swiftPart.clearUserID();
|
|
104
|
-
if (__result.hasError()) [[unlikely]] {
|
|
105
|
-
std::rethrow_exception(__result.error());
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
inline std::optional<std::string> getUserID() override {
|
|
109
|
-
auto __result = _swiftPart.getUserID();
|
|
110
|
-
if (__result.hasError()) [[unlikely]] {
|
|
111
|
-
std::rethrow_exception(__result.error());
|
|
112
|
-
}
|
|
113
|
-
auto __value = std::move(__result.value());
|
|
114
|
-
return __value;
|
|
115
|
-
}
|
|
116
|
-
inline void setUserData(const std::optional<std::string>& email, const std::optional<std::string>& firstName, const std::optional<std::string>& lastName, const std::optional<std::string>& phone, const std::optional<std::string>& dateOfBirth, const std::optional<std::string>& gender, const std::optional<std::string>& city, const std::optional<std::string>& state, const std::optional<std::string>& zip, const std::optional<std::string>& country) override {
|
|
117
|
-
auto __result = _swiftPart.setUserData(email, firstName, lastName, phone, dateOfBirth, gender, city, state, zip, country);
|
|
118
|
-
if (__result.hasError()) [[unlikely]] {
|
|
119
|
-
std::rethrow_exception(__result.error());
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
inline std::shared_ptr<Promise<std::optional<std::string>>> getAnonymousID() override {
|
|
123
|
-
auto __result = _swiftPart.getAnonymousID();
|
|
124
|
-
if (__result.hasError()) [[unlikely]] {
|
|
125
|
-
std::rethrow_exception(__result.error());
|
|
126
|
-
}
|
|
127
|
-
auto __value = std::move(__result.value());
|
|
128
|
-
return __value;
|
|
129
|
-
}
|
|
130
|
-
inline std::shared_ptr<Promise<std::optional<std::string>>> getAdvertiserID() override {
|
|
131
|
-
auto __result = _swiftPart.getAdvertiserID();
|
|
132
|
-
if (__result.hasError()) [[unlikely]] {
|
|
133
|
-
std::rethrow_exception(__result.error());
|
|
134
|
-
}
|
|
135
|
-
auto __value = std::move(__result.value());
|
|
136
|
-
return __value;
|
|
137
|
-
}
|
|
138
|
-
inline void setFlushBehavior(const std::string& flushBehavior) override {
|
|
139
|
-
auto __result = _swiftPart.setFlushBehavior(flushBehavior);
|
|
140
|
-
if (__result.hasError()) [[unlikely]] {
|
|
141
|
-
std::rethrow_exception(__result.error());
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
inline void flush() override {
|
|
145
|
-
auto __result = _swiftPart.flush();
|
|
146
|
-
if (__result.hasError()) [[unlikely]] {
|
|
147
|
-
std::rethrow_exception(__result.error());
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
inline void setPushNotificationsDeviceToken(const std::string& token) override {
|
|
151
|
-
auto __result = _swiftPart.setPushNotificationsDeviceToken(token);
|
|
152
|
-
if (__result.hasError()) [[unlikely]] {
|
|
153
|
-
std::rethrow_exception(__result.error());
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
inline void setPushNotificationsRegistrationId(const std::string& registrationId) override {
|
|
157
|
-
auto __result = _swiftPart.setPushNotificationsRegistrationId(registrationId);
|
|
158
|
-
if (__result.hasError()) [[unlikely]] {
|
|
159
|
-
std::rethrow_exception(__result.error());
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
private:
|
|
164
|
-
NitroFBAnalytics::HybridFacebookAnalyticsSpec_cxx _swiftPart;
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
} // namespace margelo::nitro::fbanalytics
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// Func_void_std__exception_ptr.swift
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
import Foundation
|
|
9
|
-
import NitroModules
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Wraps a Swift `(_ error: Error) -> Void` as a class.
|
|
13
|
-
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
-
*/
|
|
15
|
-
public final class Func_void_std__exception_ptr {
|
|
16
|
-
public typealias bridge = margelo.nitro.fbanalytics.bridge.swift
|
|
17
|
-
|
|
18
|
-
private let closure: (_ error: Error) -> Void
|
|
19
|
-
|
|
20
|
-
public init(_ closure: @escaping (_ error: Error) -> Void) {
|
|
21
|
-
self.closure = closure
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@inline(__always)
|
|
25
|
-
public func call(error: std.exception_ptr) -> Void {
|
|
26
|
-
self.closure(RuntimeError.from(cppError: error))
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Casts this instance to a retained unsafe raw pointer.
|
|
31
|
-
* This acquires one additional strong reference on the object!
|
|
32
|
-
*/
|
|
33
|
-
@inline(__always)
|
|
34
|
-
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
35
|
-
return Unmanaged.passRetained(self).toOpaque()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Casts an unsafe pointer to a `Func_void_std__exception_ptr`.
|
|
40
|
-
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__exception_ptr>`.
|
|
41
|
-
* This removes one strong reference from the object!
|
|
42
|
-
*/
|
|
43
|
-
@inline(__always)
|
|
44
|
-
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr {
|
|
45
|
-
return Unmanaged<Func_void_std__exception_ptr>.fromOpaque(pointer).takeRetainedValue()
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// Func_void_std__optional_std__string_.swift
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
import Foundation
|
|
9
|
-
import NitroModules
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Wraps a Swift `(_ value: String?) -> Void` as a class.
|
|
13
|
-
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
14
|
-
*/
|
|
15
|
-
public final class Func_void_std__optional_std__string_ {
|
|
16
|
-
public typealias bridge = margelo.nitro.fbanalytics.bridge.swift
|
|
17
|
-
|
|
18
|
-
private let closure: (_ value: String?) -> Void
|
|
19
|
-
|
|
20
|
-
public init(_ closure: @escaping (_ value: String?) -> Void) {
|
|
21
|
-
self.closure = closure
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@inline(__always)
|
|
25
|
-
public func call(value: bridge.std__optional_std__string_) -> Void {
|
|
26
|
-
self.closure({ () -> String? in
|
|
27
|
-
if bridge.has_value_std__optional_std__string_(value) {
|
|
28
|
-
let __unwrapped = bridge.get_std__optional_std__string_(value)
|
|
29
|
-
return String(__unwrapped)
|
|
30
|
-
} else {
|
|
31
|
-
return nil
|
|
32
|
-
}
|
|
33
|
-
}())
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Casts this instance to a retained unsafe raw pointer.
|
|
38
|
-
* This acquires one additional strong reference on the object!
|
|
39
|
-
*/
|
|
40
|
-
@inline(__always)
|
|
41
|
-
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
42
|
-
return Unmanaged.passRetained(self).toOpaque()
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Casts an unsafe pointer to a `Func_void_std__optional_std__string_`.
|
|
47
|
-
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__optional_std__string_>`.
|
|
48
|
-
* This removes one strong reference from the object!
|
|
49
|
-
*/
|
|
50
|
-
@inline(__always)
|
|
51
|
-
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__optional_std__string_ {
|
|
52
|
-
return Unmanaged<Func_void_std__optional_std__string_>.fromOpaque(pointer).takeRetainedValue()
|
|
53
|
-
}
|
|
54
|
-
}
|